File tree 3 files changed +13
-14
lines changed
3 files changed +13
-14
lines changed Original file line number Diff line number Diff line change @@ -17,8 +17,6 @@ builds:
17
17
goarch : 386
18
18
- goos : windows
19
19
goarch : arm64
20
- ldflags :
21
- - -s -w -X cmd.version={{.Version}} -X cmd.commit={{.Commit}} -X cmd.date={{.Date}} -X cmd.builtBy=goreleaser
22
20
23
21
# binary_signs:
24
22
# - {}
Original file line number Diff line number Diff line change 1
1
package cmd
2
2
3
3
import (
4
+ "fmt"
4
5
"os"
5
6
6
7
"github.com/spf13/cobra"
7
8
)
8
9
9
- var (
10
- version = "dev"
11
- // commit = "none"
12
- // date = "unknown"
13
- )
14
-
15
10
var RootCmd = & cobra.Command {
16
- Use : "prattl" ,
17
- Short : "Prattl is a transcription tool" ,
18
- Long : "A transcription tool built with Go and Python.\n Complete documentation is available at https://github.com/prattlOrg/prattl" ,
19
- Version : version ,
11
+ Use : "prattl" ,
12
+ Short : "Prattl is a transcription tool" ,
13
+ Long : "A transcription tool built with Go and Python.\n Complete documentation is available at https://github.com/prattlOrg/prattl" ,
20
14
}
21
15
22
- func Execute () {
16
+ func Execute (version string ) {
17
+ if version == "dev" {
18
+ RootCmd .Version = version
19
+ } else {
20
+ RootCmd .Version = fmt .Sprintf ("v%v" , version )
21
+ }
23
22
if err := RootCmd .Execute (); err != nil {
24
23
os .Exit (1 )
25
24
}
Original file line number Diff line number Diff line change @@ -7,10 +7,12 @@ import (
7
7
"github.com/prattlOrg/prattl/internal/ffmpeg"
8
8
)
9
9
10
+ var version = "dev"
11
+
10
12
func main () {
11
13
err := ffmpeg .CheckInstall ()
12
14
if err != nil {
13
15
log .Fatalf ("error creating prattl env: %v\n " , err )
14
16
}
15
- cmd .Execute ()
17
+ cmd .Execute (version )
16
18
}
You can’t perform that action at this time.
0 commit comments