Fix license path for arch

This commit is contained in:
Michal Horejsek
2020-12-10 09:33:37 +01:00
committed by Jakub Cuth
parent 7b21c2d734
commit 9c881a02d6
2 changed files with 11 additions and 1 deletions

View File

@ -206,7 +206,13 @@ func (c *Config) GetLicenseFilePath() string {
if c.appName == "importExport" {
appName = "import-export"
}
return "/usr/share/doc/protonmail/" + appName + "/LICENSE"
// Most Linux distributions.
path := "/usr/share/doc/protonmail/" + appName + "/LICENSE"
if _, err := os.Stat(path); err == nil {
return path
}
// Arch distributions.
return "/usr/share/licenses/protonmail-" + appName + "/LICENSE"
case "darwin": //nolint[goconst]
path := filepath.Join(filepath.Dir(os.Args[0]), "..", "Resources", "LICENSE")
if _, err := os.Stat(path); err == nil {