move the version to a .env file
This commit is contained in:
parent
c76e429f8b
commit
f4b40637d4
|
@ -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
|
||||
```
|
||||
|
||||
|
|
4
main.go
4
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() {
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
VERSION=1.0.0
|
Loading…
Reference in New Issue