move the version to a .env file

This commit is contained in:
blek 2023-11-03 03:11:50 +10:00
parent c76e429f8b
commit f4b40637d4
Signed by: blek
GPG Key ID: 14546221E3595D0C
3 changed files with 4 additions and 4 deletions

View File

@ -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
```

View File

@ -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() {

1
package.env Normal file
View File

@ -0,0 +1 @@
VERSION=1.0.0