mirror of https://github.com/gophish/gophish
Add option to read version from environment
Signed-off-by: W. Michael Petullo <mike@flyn.org>pull/3062/head
parent
8e79294413
commit
7670e8dbc0
13
gophish.go
13
gophish.go
|
@ -59,12 +59,15 @@ var (
|
|||
|
||||
func main() {
|
||||
// Load the version
|
||||
|
||||
version, err := ioutil.ReadFile("./VERSION")
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
version := os.Getenv("GOPHISH_VERSION")
|
||||
if version == "" {
|
||||
versionBytes, err := ioutil.ReadFile("./VERSION")
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
version = string(versionBytes)
|
||||
}
|
||||
kingpin.Version(string(version))
|
||||
kingpin.Version(version)
|
||||
|
||||
// Parse the CLI flags and load the config
|
||||
kingpin.CommandLine.HelpFlag.Short('h')
|
||||
|
|
Loading…
Reference in New Issue