fix(pkg-helper): pass -n to sudo to prevent blocking on password prompts

This commit is contained in:
Keith Patrick committed 2026-06-11 13:49:58 +01:00
1 parent d04108fff9
commit a61bbe85f6
1 file changed
+2 -1
+2 -1
View File
@@ -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()
}
}