Skip to content

Commit bfa9103

Browse files
committed
Updated. for_games/RMMZ_update_fields_CGMZ_GameInfo.py. Added "forced" attribute
1 parent ce79ce2 commit bfa9103

1 file changed

Lines changed: 13 additions & 3 deletions

File tree

for_games/RMMZ_update_fields_CGMZ_GameInfo.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
import json
88
import subprocess
9+
910
import re
1011

1112
from pathlib import Path
@@ -14,15 +15,15 @@
1415
PATTERN_FIELD_VERSION: re.Pattern = re.compile(r'(?P<left>"Left Text"\s*:\s*)".+?"')
1516

1617

17-
def process(path_dir: Path):
18+
def process(path_dir: Path, forced: bool = False):
1819
path_js_plugins: Path = path_dir / "js" / "plugins.js"
1920

2021
# If the last commit was in path_js_plugins, then skipping the file change
2122
result: bytes = subprocess.check_output(
2223
args=["git", "diff", "HEAD~1", "HEAD", path_js_plugins],
2324
cwd=path_dir,
2425
)
25-
if result:
26+
if result and not forced:
2627
print(
2728
f"Skipping change {path_js_plugins} because the file is in the last commit"
2829
)
@@ -83,6 +84,15 @@ def process(path_dir: Path):
8384
help="Path to project (the directory containing game.rmmzproject)",
8485
type=Path,
8586
)
87+
parser.add_argument(
88+
"--forced",
89+
help="Force update",
90+
action="store_true",
91+
default=False,
92+
)
8693
args = parser.parse_args()
8794

88-
process(args.path_project)
95+
process(
96+
path_dir=args.path_project,
97+
forced=args.forced,
98+
)

0 commit comments

Comments
 (0)