mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 07:12:25 -05:00
put version in binary properly (#73)
Addresses #71 : Set version on the CLI framework. Add a build.sh script that injects variables into the build tooling using git and a version file. Set version in config.
This commit is contained in:
parent
87cf621e21
commit
4f3b3f5c0b
9 changed files with 38 additions and 11 deletions
|
|
@ -33,12 +33,19 @@ import (
|
|||
"github.com/urfave/cli/v2"
|
||||
)
|
||||
|
||||
// Version is the software version of GtS being used
|
||||
var Version string
|
||||
|
||||
// Commit is the git commit of GtS being used
|
||||
var Commit string
|
||||
|
||||
func main() {
|
||||
flagNames := config.GetFlagNames()
|
||||
envNames := config.GetEnvNames()
|
||||
defaults := config.GetDefaults()
|
||||
app := &cli.App{
|
||||
Usage: "a fediverse social media server",
|
||||
Version: Version + " " + Commit[:7],
|
||||
Usage: "a fediverse social media server",
|
||||
Flags: []cli.Flag{
|
||||
// GENERAL FLAGS
|
||||
&cli.StringFlag{
|
||||
|
|
@ -399,7 +406,7 @@ func runAction(c *cli.Context, a cliactions.GTSAction) error {
|
|||
return fmt.Errorf("error creating config: %s", err)
|
||||
}
|
||||
// ... and the flags set on the *cli.Context by urfave
|
||||
if err := conf.ParseCLIFlags(c); err != nil {
|
||||
if err := conf.ParseCLIFlags(c, c.App.Version); err != nil {
|
||||
return fmt.Errorf("error parsing config: %s", err)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue