Skip to content

Commit fd2338b

Browse files
Copilotleggetter
andcommitted
fix: address code review feedback - correct Windows 32-bit compiler, error handling, and CGO settings
Co-authored-by: leggetter <328367+leggetter@users.noreply.github.com>
1 parent 1b5ea76 commit fd2338b

4 files changed

Lines changed: 9 additions & 7 deletions

File tree

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ jobs:
143143
- name: Install Windows cross-compilation tools
144144
run: |
145145
sudo apt-get update
146-
sudo apt-get install -y gcc-mingw-w64-x86-64
146+
sudo apt-get install -y gcc-mingw-w64-x86-64 gcc-mingw-w64-i686
147147
148148
- name: Build npm binaries with GoReleaser
149149
uses: goreleaser/goreleaser-action@v5

.github/workflows/test-npm-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
- name: Install Windows cross-compilation tools
2222
run: |
2323
sudo apt-get update
24-
sudo apt-get install -y gcc-mingw-w64-x86-64
24+
sudo apt-get install -y gcc-mingw-w64-x86-64 gcc-mingw-w64-i686
2525
2626
- name: Set up Node.js
2727
uses: actions/setup-node@v4

.goreleaser/npm.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ builds:
1414
goos: [darwin]
1515
goarch: [amd64]
1616
env:
17-
- CGO_ENABLED=1
17+
- CGO_ENABLED=0
1818
ldflags:
1919
- -s -w -X github.com/hookdeck/hookdeck-cli/pkg/version.Version={{.Version}}
2020
hooks:
@@ -28,6 +28,8 @@ builds:
2828
main: ./main.go
2929
goos: [darwin]
3030
goarch: [arm64]
31+
env:
32+
- CGO_ENABLED=0
3133
ldflags:
3234
- -s -w -X github.com/hookdeck/hookdeck-cli/pkg/version.Version={{.Version}}
3335
hooks:
@@ -91,8 +93,8 @@ builds:
9193
goarch: [386]
9294
env:
9395
- CGO_ENABLED=1
94-
- CC=x86_64-w64-mingw32-gcc
95-
- CXX=x86_64-w64-mingw32-g++
96+
- CC=i686-w64-mingw32-gcc
97+
- CXX=i686-w64-mingw32-g++
9698
ldflags:
9799
- -s -w -X github.com/hookdeck/hookdeck-cli/pkg/version.Version={{.Version}}
98100
hooks:

bin/hookdeck.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,6 @@ try {
3232
execFileSync(binaryPath, process.argv.slice(2), { stdio: 'inherit' });
3333
} catch (error) {
3434
// execFileSync will exit with the same code as the binary
35-
// If there's an error executing, exit with code 1
36-
process.exit(error.status || 1);
35+
// If there's an error executing (status is null or undefined), exit with code 1
36+
process.exit(error.status ?? 1);
3737
}

0 commit comments

Comments
 (0)