move pttodo-cli up from /cmd/
This commit is contained in:
20
cmd/install.sh
Normal file
20
cmd/install.sh
Normal file
@@ -0,0 +1,20 @@
|
||||
#! /bin/bash
|
||||
|
||||
cd "$(dirname "$BASH_SOURCE")"
|
||||
|
||||
binary_name="$(head -n 1 go.mod | awk '{print $NF}' | sed 's/.*\///')"
|
||||
git_commit="$((
|
||||
git rev-list -1 HEAD
|
||||
if git diff | grep . > /dev/null; then
|
||||
echo "-dirty"
|
||||
fi
|
||||
) 2> /dev/null | tr -d '\n')"
|
||||
|
||||
GOFLAGS="" \
|
||||
GO111MODULE="" \
|
||||
CGO_ENABLED=0 \
|
||||
go build \
|
||||
-o $GOPATH/bin/$binary_name \
|
||||
-a \
|
||||
-installsuffix cgo \
|
||||
-ldflags "-s -w -X main.GitCommit=$git_commit"
|
||||
Reference in New Issue
Block a user