[studio,keel] Make keel-pack command a Studio Module subcommand
Build / build (push) Failing after 26s
Build / build (push) Failing after 26s
This commit is contained in:
+8
-14
@@ -8,36 +8,30 @@
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
#
|
||||
|
||||
import platform
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
os = platform.system().lower()
|
||||
arch = platform.machine()
|
||||
host_env = f'{os}-{arch}'
|
||||
|
||||
def run(args: list[str]):
|
||||
if subprocess.run(args).returncode != 0:
|
||||
sys.exit(1)
|
||||
|
||||
# get the current build type
|
||||
with open(".current_build", "r") as f:
|
||||
current_build = f.readlines()[0]
|
||||
if current_build[-1] == '\n':
|
||||
current_build = current_build[:-1]
|
||||
|
||||
project_dir = sys.argv[1]
|
||||
project_name = sys.argv[2]
|
||||
bin = f'./build/{host_env}-{current_build}/bin/'
|
||||
studio_path = sys.argv[1]
|
||||
project_dir = sys.argv[2]
|
||||
project_name = sys.argv[3]
|
||||
project_bin = f'build/gba-release/bin/{project_name}.bin'
|
||||
project_gba = f'{project_name}.gba'
|
||||
project_manifest = f'{project_name.lower()}-manifest.json'
|
||||
|
||||
shutil.copyfile(project_bin, project_gba)
|
||||
run([
|
||||
f'{bin}/{project_name.lower()}-pack',
|
||||
'-src', project_dir,
|
||||
studio_path,
|
||||
'cmd',
|
||||
project_dir,
|
||||
'net.drinkingtea.studio',
|
||||
'pack',
|
||||
'-rom-bin', project_gba,
|
||||
'-manifest', project_manifest])
|
||||
run(['gbafix', project_gba])
|
||||
|
||||
Reference in New Issue
Block a user