mirror of
https://github.com/tiennm99/goclaw.git
synced 2026-10-15 12:14:17 +00:00
fix(pkg-helper): pass -n to sudo to prevent blocking on password prompts
This commit is contained in:
1 parent
d04108fff9
commit
a61bbe85f6
1 file changed
+2
-1
@@ -227,7 +227,8 @@ var runApkFunc = runApk
|
||||
func runApk(args ...string) ([]byte, error) {
|
||||
if os.Getuid() != 0 {
|
||||
if sudo, err := exec.LookPath("sudo"); err == nil {
|
||||
sudoArgs := append([]string{"apk"}, args...)
|
||||
// Use -n to prevent blocking on interactive password prompts
|
||||
sudoArgs := append([]string{"-n", "apk"}, args...)
|
||||
return exec.Command(sudo, sudoArgs...).CombinedOutput()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user