From 0c53f06c642e085f0886e9e5e4985ce276059c30 Mon Sep 17 00:00:00 2001 From: 1138-4EB <1138-4EB@users.noreply.github.com> Date: Wed, 22 Aug 2018 13:15:55 +0100 Subject: [PATCH] chore(version): set CLI version from lib --- build/build.sh | 2 +- cli/cmd/root.go | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/build/build.sh b/build/build.sh index 9e3c099c..2c93a7d3 100755 --- a/build/build.sh +++ b/build/build.sh @@ -11,7 +11,7 @@ if [ "$COMMIT_SHA" != "" ]; then sed -i.bak "s|(untracked)|($COMMIT_SHA)|g" ../lib/filebrowser.go fi -echo "Build cmd/filebrowser" +echo "Build CLI" CGO_ENABLED=0 go build -a -o filebrowser if [ "$COMMIT_SHA" != "" ]; then diff --git a/cli/cmd/root.go b/cli/cmd/root.go index b1037c43..678adb24 100644 --- a/cli/cmd/root.go +++ b/cli/cmd/root.go @@ -4,6 +4,7 @@ import ( "log" "strings" + fb "github.com/filebrowser/filebrowser/lib" homedir "github.com/mitchellh/go-homedir" "github.com/spf13/cobra" v "github.com/spf13/viper" @@ -14,7 +15,7 @@ var cfgFile string // rootCmd represents the base command when called without any subcommands var rootCmd = &cobra.Command{ Use: "filebrowser", - Version: "(untracked)", + Version: fb.Version, Aliases: []string{"serve"}, Short: "A stylish web-based file manager", Long: `Command 'serve' is the default. Filebrowser is started