diff --git a/README.md b/README.md index 3ec18c4..8912ca9 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,8 @@ Also this app utilizes the bFile's [cURL API](https://git.blek.codes/blek/bfile/ ```sh $ git clone this://repo $ cd repo -$ go build . +$ . ./package.env +$ go build . -ldflags "-s -w -X main.version=$VERSION" $ ./bfile_cli ``` diff --git a/main.go b/main.go index 7131004..bd5bab6 100644 --- a/main.go +++ b/main.go @@ -15,7 +15,7 @@ import "net/textproto" import "github.com/alecthomas/kong" var ( - version string + version string // To be set by compiler ) var Args struct { @@ -104,8 +104,6 @@ func upload(args *kong.Context) { } func main() { - version = "1.0.0" - args := kong.Parse(&Args, kong.Description(fmt.Sprintf("The blek! File CLI %s", version))) switch args.Command() { diff --git a/package.env b/package.env new file mode 100644 index 0000000..624bade --- /dev/null +++ b/package.env @@ -0,0 +1 @@ +VERSION=1.0.0