🐛 Linux 桌面端自动更新未赋予可执行权限 Fix https://github.com/siyuan-note/siyuan/issues/6342

This commit is contained in:
Liang Ding 2022-10-25 08:51:41 +08:00
parent d69baac71d
commit 8d1fced392
No known key found for this signature in database
GPG key ID: 136F30F901A2231D

View file

@ -43,8 +43,10 @@ func execNewVerInstallPkg(newVerInstallPkgPath string) {
if gulu.OS.IsWindows() {
cmd = exec.Command(newVerInstallPkgPath)
} else if gulu.OS.IsDarwin() {
exec.Command("chmod", "+x", newVerInstallPkgPath).CombinedOutput()
cmd = exec.Command("open", newVerInstallPkgPath)
} else if gulu.OS.IsLinux() {
exec.Command("chmod", "+x", newVerInstallPkgPath).CombinedOutput()
cmd = exec.Command("sh", "-c", newVerInstallPkgPath)
}
gulu.CmdAttr(cmd)