cli has dry mode and install script
This commit is contained in:
16
cmd/pttodo-cli/install.sh
Normal file
16
cmd/pttodo-cli/install.sh
Normal file
@@ -0,0 +1,16 @@
|
||||
#! /bin/bash
|
||||
|
||||
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')"
|
||||
|
||||
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