diff --git a/src/lean_game_maker/interactive_loader.py b/src/lean_game_maker/interactive_loader.py index b8852ad..93a6a50 100755 --- a/src/lean_game_maker/interactive_loader.py +++ b/src/lean_game_maker/interactive_loader.py @@ -29,10 +29,10 @@ def make_library(self): source_lib = "." source_lib_path = str(Path(source_lib).resolve()) + '/src' - subprocess.call(['leanpkg', 'build']) + subprocess.run(['leanpkg', 'build'], check=True) print('Using lean version:') - lean_version = subprocess.run(['lean', '-v'], capture_output=True, encoding="utf-8").stdout + lean_version = subprocess.run(['lean', '-v'], capture_output=True, encoding="utf-8", check=True).stdout print(lean_version) lean_githash = re.search("commit ([a-z0-9]{12}),", lean_version).group(1) # assume leanprover-community repo @@ -56,8 +56,8 @@ def make_library(self): elif parts[-1] != 'library': lib_name = parts[-2] # assume lean_path contains _target/deps/name/src git_dir = str(p.parent)+'/.git' - lib_rev = subprocess.run(['git', '--git-dir='+git_dir, 'rev-parse', 'HEAD'], capture_output=True, encoding="utf-8").stdout.rstrip() - lib_repo_url = subprocess.run(['git', '--git-dir='+git_dir, 'config', '--get', 'remote.origin.url'], capture_output=True, encoding="utf-8").stdout.rstrip() + lib_rev = subprocess.run(['git', '--git-dir='+git_dir, 'rev-parse', 'HEAD'], capture_output=True, encoding="utf-8", check=True).stdout.rstrip() + lib_repo_url = subprocess.run(['git', '--git-dir='+git_dir, 'config', '--get', 'remote.origin.url'], capture_output=True, encoding="utf-8", check=True).stdout.rstrip() # assume that repos are hosted at github lib_repo_match = re.search(r'github\.com[:/]([^\.]*)', lib_repo_url) if lib_repo_match: @@ -119,4 +119,4 @@ def copy_files(self, make_lib=True): distutils.dir_util.copy_tree(self.interactive_path / 'dist', str(Path(self.outdir))) distutils.dir_util.copy_tree(self.js_wasm_path, str(Path(self.outdir))) if make_lib: - self.make_library() \ No newline at end of file + self.make_library()