mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-11-26 11:51:02 +00:00
added revision number to drone
binary, per issue #230
This commit is contained in:
parent
e6f2ba05a9
commit
7184da9ca4
2 changed files with 9 additions and 1 deletions
2
Makefile
2
Makefile
|
@ -56,7 +56,7 @@ js:
|
|||
cd cmd/droned/assets && find js -name "*.js" ! -name '.*' ! -name "main.js" -exec cat {} \; > js/main.js
|
||||
|
||||
build:
|
||||
cd cmd/drone && go build -o ../../bin/drone
|
||||
cd cmd/drone && go build -ldflags "-X main.version $(SHA)" -o ../../bin/drone
|
||||
cd cmd/droned && go build -ldflags "-X main.version $(SHA)" -o ../../bin/droned
|
||||
|
||||
test: $(PKGS)
|
||||
|
|
|
@ -39,6 +39,10 @@ var (
|
|||
|
||||
// displays the help / usage if True
|
||||
help = flag.Bool("h", false, "")
|
||||
|
||||
// version number, currently deterined by the
|
||||
// git revision number (sha)
|
||||
version string
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
@ -103,6 +107,10 @@ func main() {
|
|||
path = filepath.Join(path, ".drone.yml")
|
||||
vet(path)
|
||||
|
||||
// print the version / revision number
|
||||
case args[0] == "version" && len(args) == 1:
|
||||
println(version)
|
||||
|
||||
// print the help message
|
||||
case args[0] == "help" && len(args) == 1:
|
||||
flag.Usage()
|
||||
|
|
Loading…
Reference in a new issue