From 5d0f88a926c0a63255a9e678fdcc1fba2077cf7a Mon Sep 17 00:00:00 2001 From: charburgx Date: Thu, 19 Sep 2024 17:08:59 -0700 Subject: [PATCH] chore: include exe extension on windows azl buid --- package.json | 2 +- scripts/build-azl-go.ts | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 scripts/build-azl-go.ts diff --git a/package.json b/package.json index 64179cb..d268777 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "build:cjs": "tsup --config ./tsup.cjs.config.ts && resolve-tspaths --out ./dist/cjs && shx cp ./package.cjs.json ./dist/cjs/package.json && renamer --find .d.cts --replace .d.ts ./dist/cjs/**/*.d.cts", "build:scripts:cjs": "tsup --config ./tsup.scripts.cjs.config.ts && shx cp ./package.cli.json ./dist/scripts/cjs/package.json", "build:cli": "npm run build:scripts:cjs && cross-env-shell pkg ./dist/scripts/cjs --out-path ./dist/binary -t node20-$PKG_TARGET --debug && npm run build:cli:azl", - "build:cli:azl": "cross-env go build -o ./dist/binary/azl ./azl.go", + "build:cli:azl": "tsx ./scripts/build-azl-go.ts", "bundle:cli": "npm run build:cli && tsx ./scripts/bundle-cli.ts" }, "keywords": [], diff --git a/scripts/build-azl-go.ts b/scripts/build-azl-go.ts new file mode 100644 index 0000000..953f386 --- /dev/null +++ b/scripts/build-azl-go.ts @@ -0,0 +1,6 @@ +import { execSync } from "node:child_process" +import os from "node:os" + +const cmd = `go build -o ./dist/binary/azl${os.platform() === "win32" ? ".exe" : ""} ./azl.go` + +execSync(cmd, { stdio: "inherit" })