mirror of
https://github.com/safing/portbase
synced 2025-09-01 18:19:57 +00:00
Check for windows test executable when checking version information
This commit is contained in:
parent
f02672e313
commit
8e578cb45e
1 changed files with 8 additions and 1 deletions
|
@ -85,7 +85,13 @@ func FullVersion() string {
|
|||
|
||||
// CheckVersion checks if the metadata is ok.
|
||||
func CheckVersion() error {
|
||||
if !strings.HasSuffix(os.Args[0], ".test") {
|
||||
switch {
|
||||
case strings.HasSuffix(os.Args[0], ".test"):
|
||||
return nil // testing on linux/darwin
|
||||
case strings.HasSuffix(os.Args[0], ".test.exe"):
|
||||
return nil // testing on windows
|
||||
default:
|
||||
// check version information
|
||||
if name == "[NAME]" {
|
||||
return errors.New("must call SetInfo() before calling CheckVersion()")
|
||||
}
|
||||
|
@ -100,5 +106,6 @@ func CheckVersion() error {
|
|||
return errors.New("please build using the supplied build script.\n$ ./build {main.go|...}")
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue