diff --git a/cmd/willow.go b/cmd/willow.go index bb12fc163f9bdffd5a666a3ab5684b045caedde6..337fa29258c88891a8dc941b192c3965bbcf72d8 100644 --- a/cmd/willow.go +++ b/cmd/willow.go @@ -39,8 +39,10 @@ var ( flagConfig = flag.StringP("config", "c", "config.toml", "Path to config file") flagAddUser = flag.StringP("add", "a", "", "Username of account to add") flagDeleteUser = flag.StringP("deleteuser", "d", "", "Username of account to delete") - flagCheckAuthorised = flag.StringP("validatecredentials", "v", "", "Username of account to check") + flagCheckAuthorised = flag.StringP("validatecredentials", "V", "", "Username of account to check") flagListUsers = flag.BoolP("listusers", "l", false, "List all users") + flagShowVersion = flag.BoolP("version", "v", false, "Print Willow's version") + version = "" config Config req = make(chan struct{}) res = make(chan []project.Project) @@ -50,6 +52,11 @@ var ( func main() { flag.Parse() + if *flagShowVersion { + fmt.Println(version) + os.Exit(0) + } + err := checkConfig() if err != nil { log.Fatalln(err) @@ -101,6 +108,7 @@ func main() { Res: &res, ManualRefresh: &manualRefresh, Mu: &mu, + Version: &version, } mux := http.NewServeMux() diff --git a/justfile b/justfile index a8b7320e8e1ec8f72c24160fcf4609d21edfed52..953900891b9e7662fa6c7183e18b0b7422518f02 100644 --- a/justfile +++ b/justfile @@ -31,6 +31,10 @@ reuse: # Linting licenses and copyright headers reuse lint +build: + # Building Willow + go build -o willow -ldflags "-s -w -X main.version=`git describe --long 2>/dev/null | sed 's/\([^-]*-g\)/r\1/;s/-/./g'`" ./cmd + clean: # Cleaning up rm -rf willow out/ diff --git a/ws/static/home.html b/ws/static/home.html index 65b899635180910a4a0de4ce1a667967c8963348..6086e72d4e8b2bba590ef61e8c16ddb7f1741d85 100644 --- a/ws/static/home.html +++ b/ws/static/home.html @@ -34,13 +34,13 @@