Skip to content

Commit 6a282a0

Browse files
committed
Fix windows bin and add nashfmt
1 parent 4846ab7 commit 6a282a0

File tree

2 files changed

+19
-6
lines changed

2 files changed

+19
-6
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ release:
3232
clean:
3333
rm -f cmd/nash/nash
3434
rm -f cmd/nashfmt/nashfmt
35-
rm -f dist
35+
rm -rf dist

hack/releaser.sh

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,31 @@ setenv CGO_ENABLED = "0"
1515

1616
mkdir -p dist
1717

18+
fn copy_exec(src, dst) {
19+
if $os == "windows" {
20+
src = $src+".exe"
21+
dst = $dst+".exe"
22+
}
23+
24+
cp $src $dst
25+
}
26+
1827
for os in $supported_os {
1928
setenv GOOS = $os
2029
setenv GOARCH = "amd64"
2130

2231
echo "building OS: "+$GOOS+" ARCH : "+$GOARCH
2332
make build "version="+$version
2433

25-
binpath <= format("dist/nash-%s-%s-amd64", $version, $os)
34+
source_nash = "cmd/nash/nash"
2635

27-
if $os != "windows" {
28-
binpath = $binpath+".exe"
29-
}
36+
target_nash <= format("dist/nash-%s-%s-amd64", $version, $os)
37+
38+
copy_exec($source_nash, $target_nash)
39+
40+
source_nashfmt = "cmd/nashfmt/nashfmt"
41+
42+
target_nashfmt <= format("dist/nashfmt-%s-%s-amd64", $version, $os)
3043

31-
cp "cmd/nash/nash" $binpath
44+
copy_exec($source_nashfmt, $target_nashfmt)
3245
}

0 commit comments

Comments
 (0)