-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcrafting-build-main.py
executable file
·46 lines (39 loc) · 1.49 KB
/
crafting-build-main.py
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import subprocess
import argparse
def run_build_script(folder, version):
"""Run the crafting-build.py script for a given folder and version."""
try:
# Call the build.py script using subprocess
subprocess.run(
['python3', 'crafting-build.py', folder, version],
check=True # Will raise an error if the script fails
)
print(f"Successfully processed {folder} with version {version}")
except subprocess.CalledProcessError as e:
print(f"Error while processing {folder}: {e}")
def main():
# Set up argument parsing for version
parser = argparse.ArgumentParser(description="Run crafting-build.py script for multiple folders with a single version.")
parser.add_argument('version', help="Version number to use for all folders.")
args = parser.parse_args()
folders = [
'craftable-tridents',
'craftable-rooted-dirt',
'craftable-enchanted-golden-apples',
'copper-door-cutting',
'craftable-horse-armor',
'craftable-elytra',
'craftable-nametags',
'craftable-tall-grass',
'craftable-bells',
'craftable-saddles',
'craftable-chainmail'
# Add new folders here when needed
]
# Get the version from the argument
version = args.version
# Loop over all folders and execute build.py for each one with the given version
for folder in folders:
run_build_script(folder, version)
if __name__ == '__main__':
main()