W. Michael Petullo 2024-01-02 15:14:08 -06:00 committed by GitHub
commit d93f2149af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 5 deletions

View File

@ -59,12 +59,15 @@ var (
func main() { func main() {
// Load the version // Load the version
version := os.Getenv("GOPHISH_VERSION")
version, err := ioutil.ReadFile("./VERSION") if version == "" {
versionBytes, err := ioutil.ReadFile("./VERSION")
if err != nil { if err != nil {
log.Fatal(err) log.Fatal(err)
} }
kingpin.Version(string(version)) version = string(versionBytes)
}
kingpin.Version(version)
// Parse the CLI flags and load the config // Parse the CLI flags and load the config
kingpin.CommandLine.HelpFlag.Short('h') kingpin.CommandLine.HelpFlag.Short('h')