diff --git a/cmd.go b/cmd.go index 2506a6ac..24e1ce0a 100644 --- a/cmd.go +++ b/cmd.go @@ -665,6 +665,10 @@ func passToPacman(args *arguments) error { argArr = append(argArr, "pacman") argArr = append(argArr, cmdArgs.formatGlobals()...) argArr = append(argArr, args.formatArgs()...) + if config.NoConfirm { + argArr = append(argArr, "--noconfirm") + } + argArr = append(argArr, args.formatTargets()...) cmd = exec.Command(argArr[0], argArr[1:]...) @@ -676,6 +680,11 @@ func passToPacman(args *arguments) error { // passToMakepkg outsources execution to makepkg binary without modifications. func passToMakepkg(dir string, args ...string) (err error) { + + if config.NoConfirm { + args = append(args) + } + cmd := exec.Command(config.MakepkgBin, args...) cmd.Stdin, cmd.Stdout, cmd.Stderr = os.Stdin, os.Stdout, os.Stderr cmd.Dir = dir diff --git a/config.go b/config.go index c55bdee2..6646a0f6 100644 --- a/config.go +++ b/config.go @@ -5,7 +5,6 @@ import ( "fmt" "os" "os/exec" - "os/user" alpm "github.com/jguer/go-alpm" ) @@ -103,11 +102,7 @@ func (config *Configuration) saveConfig() error { } func defaultSettings(config *Configuration) { - u, err := user.Current() - if err != nil { - panic(err) - } - config.BuildDir = fmt.Sprintf("/tmp/yaytmp-%s/", u.Uid) + config.BuildDir = fmt.Sprintf("%s/.cache/yay/", os.Getenv("HOME")) config.CleanAfter = false config.Editor = "" config.Devel = false