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
|
```sh
|
||||||
$ git clone this://repo
|
$ git clone this://repo
|
||||||
$ cd repo
|
$ cd repo
|
||||||
$ go build .
|
$ . ./package.env
|
||||||
|
$ go build . -ldflags "-s -w -X main.version=$VERSION"
|
||||||
$ ./bfile_cli
|
$ ./bfile_cli
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
4
main.go
4
main.go
|
@ -15,7 +15,7 @@ import "net/textproto"
|
||||||
import "github.com/alecthomas/kong"
|
import "github.com/alecthomas/kong"
|
||||||
|
|
||||||
var (
|
var (
|
||||||
version string
|
version string // To be set by compiler
|
||||||
)
|
)
|
||||||
|
|
||||||
var Args struct {
|
var Args struct {
|
||||||
|
@ -104,8 +104,6 @@ func upload(args *kong.Context) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
version = "1.0.0"
|
|
||||||
|
|
||||||
args := kong.Parse(&Args, kong.Description(fmt.Sprintf("The blek! File CLI %s", version)))
|
args := kong.Parse(&Args, kong.Description(fmt.Sprintf("The blek! File CLI %s", version)))
|
||||||
|
|
||||||
switch args.Command() {
|
switch args.Command() {
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
VERSION=1.0.0
|
Loading…
Reference in New Issue