Fixed incorrect OS detection
This commit is contained in:
@ -27,7 +27,7 @@ var (
|
||||
TargetArch string
|
||||
|
||||
// Target platform.
|
||||
TargetOS string
|
||||
TargetOS OS
|
||||
)
|
||||
|
||||
// Reset resets the configuration to its default values.
|
||||
@ -36,9 +36,14 @@ func Reset() {
|
||||
ConstantFold = true
|
||||
Dry = false
|
||||
TargetArch = runtime.GOARCH
|
||||
TargetOS = runtime.GOOS
|
||||
TargetOS = Unknown
|
||||
|
||||
if TargetOS == "darwin" {
|
||||
TargetOS = "mac"
|
||||
switch runtime.GOOS {
|
||||
case "linux":
|
||||
TargetOS = Linux
|
||||
case "darwin":
|
||||
TargetOS = Mac
|
||||
case "windows":
|
||||
TargetOS = Windows
|
||||
}
|
||||
}
|
||||
|
10
src/config/os.go
Normal file
10
src/config/os.go
Normal file
@ -0,0 +1,10 @@
|
||||
package config
|
||||
|
||||
type OS uint8
|
||||
|
||||
const (
|
||||
Unknown OS = iota
|
||||
Linux
|
||||
Mac
|
||||
Windows
|
||||
)
|
Reference in New Issue
Block a user