5
0
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:
Lea Anthony 2019-05-27 18:41:26 +10:00 committed by GitHub
commit 068443f3fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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