mirror of
https://github.com/safing/portbase
synced 2025-09-01 18:19:57 +00:00
Update info module to start first, improve sanity checking
This commit is contained in:
parent
2fb83cecb8
commit
09616a0c25
1 changed files with 5 additions and 3 deletions
|
@ -15,7 +15,7 @@ var (
|
|||
)
|
||||
|
||||
func init() {
|
||||
modules.Register("info", prep, nil, nil, "base")
|
||||
modules.Register("info", prep, nil, nil)
|
||||
|
||||
flag.BoolVar(&showVersion, "version", false, "show version and exit")
|
||||
}
|
||||
|
@ -35,8 +35,10 @@ func prep() error {
|
|||
// CheckVersion checks if the metadata is ok.
|
||||
func CheckVersion() error {
|
||||
if !strings.HasSuffix(os.Args[0], ".test") {
|
||||
if name == "[NAME]" ||
|
||||
version == "[version unknown]" ||
|
||||
if name == "[NAME]" {
|
||||
return errors.New("must call SetInfo() before calling CheckVersion()")
|
||||
}
|
||||
if version == "[version unknown]" ||
|
||||
commit == "[commit unknown]" ||
|
||||
license == "[license unknown]" ||
|
||||
buildOptions == "[options unknown]" ||
|
||||
|
|
Loading…
Add table
Reference in a new issue