-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathtestinginstallpn.py
More file actions
26 lines (21 loc) · 972 Bytes
/
testinginstallpn.py
File metadata and controls
26 lines (21 loc) · 972 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import re
import os
# Path to the file to be modified
file_path = os.path.join("src", "app", "plugins", "plugins.routing.ts")
# Read the content of the file
with open(file_path, "r") as file:
content = file.read()
# Define the replacements
replacements = [
(r"// INSERT ROUTES HERE", " {\n// INSERT ROUTES HERE"),
(r"// INSERT ROUTES HERE", " path: 'items-planning-pn',\n// INSERT ROUTES HERE"),
(r"// INSERT ROUTES HERE", " loadChildren: () => import('./modules/items-planning-pn/items-planning-pn.module')\n// INSERT ROUTES HERE"),
(r"// INSERT ROUTES HERE", " .then(m => m.ItemsPlanningPnModule)\n// INSERT ROUTES HERE"),
(r"// INSERT ROUTES HERE", " },\n// INSERT ROUTES HERE"),
]
# Apply each replacement in sequence
for pattern, replacement in replacements:
content = re.sub(pattern, replacement, content, count=1)
# Write the modified content back to the file
with open(file_path, "w") as file:
file.write(content)