Skip to content

Commit 8b53d6e

Browse files
committed
Add version parameter
1 parent 35e366b commit 8b53d6e

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

cmd/nash/Makefile

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
all: build install
22

3-
ifndef VERSION
4-
VERSION=$(shell git rev-list -1 HEAD)
3+
ifndef version
4+
version=$(shell git rev-list -1 HEAD)
55
endif
66

7-
BUILDARGS = -ldflags "-X main.VersionString=$(VERSION)" -v
8-
UNAME_S := $(shell uname -s)
7+
buildargs = -ldflags "-X main.VersionString=$(version)" -v
98

109
build:
11-
@echo "building nash version: "$(VERSION)
12-
GO15VENDOREXPERIMENT=1 go build $(BUILDARGS)
10+
@echo "building nash version: "$(version)
11+
GO15VENDOREXPERIMENT=1 go build $(buildargs)
1312

1413
install:
15-
GO15VENDOREXPERIMENT=1 go install $(BUILDARGS)
14+
GO15VENDOREXPERIMENT=1 go install $(buildargs)

hack/releaser.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,24 @@
11
#!/usr/bin/env nash
22

3+
if len($ARGS) != "2" {
4+
print("usage: %s <version>\n\n", $ARGS[0])
5+
exit("1")
6+
}
7+
8+
version = $ARGS[1]
39
supported_os = ("linux" "darwin" "windows")
410

511
# Guarantee passing tests at least on the host arch/os
612
make test
713

814
setenv CGO_ENABLED="0"
15+
mkdir -p dist
916

1017
for os in $supported_os {
1118
setenv GOOS = $os
1219
setenv GOARCH = "amd64"
1320
echo "building OS: " + $GOOS + " ARCH : " + $GOARCH
14-
make build
15-
mkdir -p dist
21+
make build "version=" + $version
1622
if $os != "windows" {
1723
cp "cmd/nash/nash" "dist/nash-"+$os+"-amd64"
1824
} else {

0 commit comments

Comments
 (0)