5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-03 11:43:20 +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`)
// 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