File tree Expand file tree Collapse file tree 3 files changed +44
-1
lines changed
Expand file tree Collapse file tree 3 files changed +44
-1
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,10 @@ VERSION := $(shell git describe --always --long --dirty)
22DATE := $(shell date +% s)
33LDFLAGS := -ldflags="-X main.buildVersion=${VERSION}"
44
5- .PHONY : pms test linux-amd64 linux-arm64 linux-arm darwin-amd64 darwin-arm64 windows-amd64.exe
5+ .PHONY : install pms test linux-amd64 linux-arm64 linux-arm darwin-amd64 darwin-arm64 windows-amd64.exe
6+
7+ install : pms
8+ sh ./install.sh
69
710pms :
811 go build ${LDFLAGS} -o build/pms main.go
Original file line number Diff line number Diff line change @@ -49,6 +49,13 @@ make install
4949```
5050
5151This will put the binary in ` $GOBIN/pms ` , usually at ` ~/go/bin/pms ` .
52+
53+ If you prefer to link the binary instead of copying it, set the ` INSTALL_TYPE ` environment variable to ` link ` :
54+
55+ ``` sh
56+ INSTALL_TYPE=link make install
57+ ```
58+
5259You need to run PMS in a regular terminal with a TTY.
5360
5461If PMS crashes, and you want to report a bug, please include the debug log:
Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+
3+ # Infer GOBIN from GOPATH if necessary and able to
4+ [ " $GOBIN " == " " ] && [ " $GOPATH " != " " ] &&
5+ echo " [warning] missing \$ GOBIN, using $GOPATH /bin" &&
6+ GOBIN=" $GOPATH /bin"
7+
8+ # Make sure we know where to copy to
9+ [ " $GOBIN " == " " ] &&
10+ echo ' [error] $GOBIN not set' &&
11+ exit 1
12+
13+ SOURCE=" $( pwd) /build/pms"
14+ DESTINATION=" $GOBIN /pms"
15+
16+ # Make sure we have something to copy
17+ [ ! -f " $SOURCE " ] &&
18+ echo " [error] $SOURCE not found" &&
19+ exit 1
20+
21+ # Make room for the binary
22+ [ -f " $DESTINATION " ] &&
23+ echo " [warning] removing existing binary $DESTINATION " &&
24+ rm -f " $DESTINATION "
25+
26+ # Check if the user wanted to link instead of copy
27+ [ " $INSTALL_TYPE " == " link" ] &&
28+ echo " [info] linking $SOURCE to $DESTINATION " &&
29+ ln -sf " $SOURCE " " $DESTINATION " &&
30+ exit 0
31+
32+ echo " [info] copying $SOURCE to $DESTINATION "
33+ cp " $SOURCE " " $DESTINATION "
You can’t perform that action at this time.
0 commit comments