mirror of
https://github.com/safing/portbase
synced 2025-09-02 10:40:39 +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() {
|
func init() {
|
||||||
modules.Register("info", prep, nil, nil, "base")
|
modules.Register("info", prep, nil, nil)
|
||||||
|
|
||||||
flag.BoolVar(&showVersion, "version", false, "show version and exit")
|
flag.BoolVar(&showVersion, "version", false, "show version and exit")
|
||||||
}
|
}
|
||||||
|
@ -35,8 +35,10 @@ func prep() error {
|
||||||
// CheckVersion checks if the metadata is ok.
|
// CheckVersion checks if the metadata is ok.
|
||||||
func CheckVersion() error {
|
func CheckVersion() error {
|
||||||
if !strings.HasSuffix(os.Args[0], ".test") {
|
if !strings.HasSuffix(os.Args[0], ".test") {
|
||||||
if name == "[NAME]" ||
|
if name == "[NAME]" {
|
||||||
version == "[version unknown]" ||
|
return errors.New("must call SetInfo() before calling CheckVersion()")
|
||||||
|
}
|
||||||
|
if version == "[version unknown]" ||
|
||||||
commit == "[commit unknown]" ||
|
commit == "[commit unknown]" ||
|
||||||
license == "[license unknown]" ||
|
license == "[license unknown]" ||
|
||||||
buildOptions == "[options unknown]" ||
|
buildOptions == "[options unknown]" ||
|
||||||
|
|
Loading…
Add table
Reference in a new issue