Merge pull request #562 from Morganamilo/#560

Add --makepkgconf
This commit is contained in:
Anna 2018-07-24 13:08:21 +01:00 committed by GitHub
commit 96532c0b27
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 0 deletions

4
cmd.go
View file

@ -273,6 +273,10 @@ func handleConfig(option, value string) bool {
config.EditorFlags = value
case "makepkg":
config.MakepkgBin = value
case "makepkgconf":
config.MakepkgConf = value
case "nomakepkgconf":
config.MakepkgConf = ""
case "pacman":
config.PacmanBin = value
case "tar":

View file

@ -39,6 +39,7 @@ type Configuration struct {
Editor string `json:"editor"`
EditorFlags string `json:"editorflags"`
MakepkgBin string `json:"makepkgbin"`
MakepkgConf string `json:"makepkgconf"`
PacmanBin string `json:"pacmanbin"`
PacmanConf string `json:"pacmanconf"`
TarBin string `json:"tarbin"`
@ -153,6 +154,7 @@ func defaultSettings(config *Configuration) {
config.EditorFlags = ""
config.Devel = false
config.MakepkgBin = "makepkg"
config.MakepkgConf = ""
config.NoConfirm = false
config.PacmanBin = "pacman"
config.PGPFetch = true

View file

@ -103,6 +103,10 @@ func passToMakepkg(dir string, args ...string) *exec.Cmd {
mflags := strings.Fields(config.MFlags)
args = append(args, mflags...)
if config.MakepkgConf != "" {
args = append(args, "--config", config.MakepkgConf)
}
cmd := exec.Command(config.MakepkgBin, args...)
cmd.Dir = dir
return cmd

View file

@ -452,6 +452,8 @@ func hasParam(arg string) bool {
return true
case "makepkg":
return true
case "makepkgconf":
return true
case "pacman":
return true
case "tar":