Skip to content

Commit cd4839d

Browse files
authored
Add build script
1 parent ea0f60a commit cd4839d

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

.editorconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,6 @@ indent_size = 2
2424

2525
[Makefile]
2626
indent_style = tab
27+
28+
[*.sh]
29+
indent_style = tab

build.sh

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/bin/bash
2+
# Builds the binary for several platforms
3+
# TODO: More portable script that uses sh instead of bash
4+
set -e
5+
6+
platforms=(
7+
darwin-amd64
8+
linux-amd64
9+
linux-386
10+
windows-amd64
11+
windows-386
12+
openbsd-amd64
13+
openbsd-386
14+
freebsd-amd64
15+
freebsd-386
16+
netbsd-amd64
17+
netbsd-386
18+
)
19+
20+
for platform in "${platforms[@]}"; do
21+
goos=${platform%-*}
22+
goarch=${platform##*-}
23+
ext=""
24+
if [ "$goos" = "windows" ]; then
25+
ext=".exe"
26+
fi
27+
GOOS=${platform%-*} GOARCH=${platform##*-} go build -o "dist/git-lzc-$platform$ext" ./cmd/git-lzc
28+
done
29+
30+

0 commit comments

Comments
 (0)