mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-06 10:01:06 +08:00
Merge pull request #110 from ocelotsloth/develop
CMD: LINUX: Arch Linux detection without lsb-release
This commit is contained in:
commit
068443f3fd
12
cmd/linux.go
12
cmd/linux.go
@ -77,10 +77,16 @@ func GetLinuxDistroInfo() *DistroInfo {
|
|||||||
re := regexp.MustCompile(`^NAME=(.*)\n`)
|
re := regexp.MustCompile(`^NAME=(.*)\n`)
|
||||||
// extract the distro name
|
// extract the distro name
|
||||||
osName := string(re.FindSubmatch(osRelease)[1])
|
osName := string(re.FindSubmatch(osRelease)[1])
|
||||||
// Check distro name against list of RedHat distros
|
// strip quotations
|
||||||
if osName == "Fedora" || osName == "CentOS" {
|
osName = strings.Trim(osName, "\"")
|
||||||
//if it matches set result.Distribution to RedHat
|
// Check distro name against list of distros
|
||||||
|
switch osName {
|
||||||
|
case "Fedora":
|
||||||
result.Distribution = RedHat
|
result.Distribution = RedHat
|
||||||
|
case "CentOS":
|
||||||
|
result.Distribution = RedHat
|
||||||
|
case "Arch Linux":
|
||||||
|
result.Distribution = Arch
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result
|
return result
|
||||||
|
Loading…
Reference in New Issue
Block a user