File tree Expand file tree Collapse file tree 2 files changed +14
-9
lines changed Expand file tree Collapse file tree 2 files changed +14
-9
lines changed Original file line number Diff line number Diff line change 1
1
all : build install
2
2
3
- ifndef VERSION
4
- VERSION =$(shell git rev-list -1 HEAD)
3
+ ifndef version
4
+ version =$(shell git rev-list -1 HEAD)
5
5
endif
6
6
7
- BUILDARGS = -ldflags "-X main.VersionString=$(VERSION ) " -v
8
- UNAME_S := $(shell uname -s)
7
+ buildargs = -ldflags "-X main.VersionString=$(version ) " -v
9
8
10
9
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 )
13
12
14
13
install :
15
- GO15VENDOREXPERIMENT=1 go install $(BUILDARGS )
14
+ GO15VENDOREXPERIMENT=1 go install $(buildargs )
Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env nash
2
2
3
+ if len($ARGS ) ! = " 2" {
4
+ print(" usage: %s <version>\n\n" , $ARGS [0])
5
+ exit(" 1" )
6
+ }
7
+
8
+ version = $ARGS [1]
3
9
supported_os = (" linux" " darwin" " windows" )
4
10
5
11
# Guarantee passing tests at least on the host arch/os
6
12
make test
7
13
8
14
setenv CGO_ENABLED=" 0"
15
+ mkdir -p dist
9
16
10
17
for os in $supported_os {
11
18
setenv GOOS = $os
12
19
setenv GOARCH = " amd64"
13
20
echo " building OS: " + $GOOS + " ARCH : " + $GOARCH
14
- make build
15
- mkdir -p dist
21
+ make build " version=" + $version
16
22
if $os ! = " windows" {
17
23
cp " cmd/nash/nash" " dist/nash-" +$os +" -amd64"
18
24
} else {
You can’t perform that action at this time.
0 commit comments