Skip to content

Commit a953da0

Browse files
authored
change binary names to work with git latest download (#7)
Signed-off-by: Nico Braun <[email protected]>
1 parent c44f290 commit a953da0

File tree

2 files changed

+8
-17
lines changed

2 files changed

+8
-17
lines changed

Makefile

+7-14
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,21 @@
11
ver=0.2.0
2-
bindir=bin
3-
container_cli=docker
2+
bin_dir=bin
43
cmd_dir=./cmd/tpl/
4+
container_cli=docker
55

66
ldflags=-X 'main.version=$(ver)' -X 'main.commit=$(shell git rev-parse HEAD)'
77

88
binaries: bindir dynmaic static
99

1010
dynmaic:
11-
go build -ldflags="$(ldflags)" -a -o tpl-$(ver)-amd64 $(cmd_dir)
12-
tar -czf tpl-amd64.tar.gz tpl-$(ver)-amd64
13-
mv tpl-amd64.tar.gz bin/
14-
rm tpl-$(ver)-amd64
11+
go build -ldflags="$(ldflags)" -a -o $(bin_dir)/tpl-linux-amd64 $(cmd_dir)
1512

1613
static:
17-
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="$(ldflags)" -a -o tpl-$(ver)-amd64-static $(cmd_dir)
18-
tar -czf tpl-amd64-static.tar.gz tpl-$(ver)-amd64-static
19-
mv tpl-amd64-static.tar.gz bin/
20-
rm tpl-$(ver)-amd64-static
14+
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="$(ldflags)" -a -o $(bin_dir)/tpl-linux-amd64-static $(cmd_dir)
2115

2216
bindir:
23-
rm -rf $(bindir)
24-
mkdir -p $(bindir)
17+
rm -rf $(bin_dir)
18+
mkdir -p $(bin_dir)
2519

2620
image:
2721
$(container_cli) build --file assets/container/Dockerfile --build-arg ldflags="$(ldflags)" -t bluebrown/tpl -t bluebrown/tpl:$(ver) .
@@ -31,8 +25,7 @@ push:
3125
$(container_cli) push bluebrown/tpl:$(ver)
3226

3327
install: binaries
34-
tar -xzf bin/tpl-amd64.tar.gz
35-
sudo mv tpl-$(ver)-amd64 /usr/local/bin/tpl
28+
sudo mv $(bin_dir)/tpl-linux-amd64 /usr/local/$(bin_dir)/tpl
3629

3730

3831
.PHONY: binaries dynamic static bindir image push install

README.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,7 @@ Next to the builtin functions, sSprig functions](http://masterminds.github.io/sp
7878
Download the binary from the [release page](https://github.com/bluebrown/go-template-cli/releases). For example
7979

8080
```bash
81-
curl -fsSLO https://github.com/bluebrown/go-template-cli/releases/download/v0.1.1/tpl-amd64-static.tar.gz
82-
tar -xzf tpl-amd64-static.tar.gz
83-
mv tpl-0.1.1-amd64-static /usr/local/bin/tpl
81+
curl -fsSL https://github.com/bluebrown/go-template-cli/releases/latest/download/tpl-linux-amd64 >tpl
8482
```
8583

8684
### Go

0 commit comments

Comments
 (0)