build: fix subprocess args

This commit is contained in:
Greg T. Wallace 2025-06-19 23:04:53 -04:00
parent 6343cb0912
commit 6537b88ffa

View file

@ -37,7 +37,7 @@ os.makedirs(outBaseDir)
os.makedirs(releaseDir)
# get version number / tag
gitTag = subprocess.check_output("git describe --tags --abbrev=0").decode('utf-8').strip()
gitTag = subprocess.check_output(["git", "describe", "--tags", "--abbrev=0"]).decode('utf-8').strip()
# loop through and build all targets
for target in targets:
@ -60,8 +60,8 @@ for target in targets:
extension = ".exe"
# build binary and install only binary
subprocess.run(f"go build -o {targetOutDir}/apc-p15-tool{extension} ./cmd/tool")
subprocess.run(f"go build -o {targetOutDir}/apc-p15-install{extension} ./cmd/install_only")
subprocess.run(["go", "build", "-o", f"{targetOutDir}/apc-p15-tool{extension}", "./cmd/tool"])
subprocess.run(["go", "build", "-o", f"{targetOutDir}/apc-p15-install{extension}", "./cmd/install_only"])
# copy other important files for release
shutil.copy("README.md", targetOutDir)