mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-04 01:50:09 +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`)
|
||||
// extract the distro name
|
||||
osName := string(re.FindSubmatch(osRelease)[1])
|
||||
// Check distro name against list of RedHat distros
|
||||
if osName == "Fedora" || osName == "CentOS" {
|
||||
//if it matches set result.Distribution to RedHat
|
||||
// strip quotations
|
||||
osName = strings.Trim(osName, "\"")
|
||||
// Check distro name against list of distros
|
||||
switch osName {
|
||||
case "Fedora":
|
||||
result.Distribution = RedHat
|
||||
case "CentOS":
|
||||
result.Distribution = RedHat
|
||||
case "Arch Linux":
|
||||
result.Distribution = Arch
|
||||
}
|
||||
}
|
||||
return result
|
||||
|
Loading…
Reference in New Issue
Block a user