We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 958e9e3 commit e4f49b6Copy full SHA for e4f49b6
1 file changed
monorepo-migration/update_root_pom.py
@@ -13,6 +13,7 @@
13
# See the License for the specific language governing permissions and
14
# limitations under the License.
15
16
+import re
17
import sys
18
19
def update_root_pom(pom_path, module_name):
@@ -39,7 +40,7 @@ def update_root_pom(pom_path, module_name):
39
40
java_lines = lines[start_java:end_java]
41
if not any(f'<module>{module_name}</module>' in l for l in java_lines):
42
java_lines.append(new_module)
- java_lines.sort()
43
+ java_lines.sort(key=lambda l: re.search(r'<module>(.*?)</module>', l).group(1) if '<module>' in l else l)
44
lines = lines[:start_java] + java_lines + lines[end_java:]
45
else:
46
if not any(f'<module>{module_name}</module>' in l for l in lines):
0 commit comments