Skip to content

Commit

Permalink
do not pass config unless one is in use: fixes #14
Browse files Browse the repository at this point in the history
  • Loading branch information
bradrf committed Jun 12, 2022
1 parent bb5041e commit 7f84829
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions cmd/menu.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,13 @@ func ensureWaitRunning(cmd *cobra.Command) error {
execArgs = []string{"--user", "root"}
}

config := viper.GetViper().ConfigFileUsed()
if config != "" {
config = " --config " + config
}

// use sh exec to let parent processes exit
hkCmd := fmt.Sprint("export ", dpEnv, "; exec ", exe,
" --config ", viper.GetViper().ConfigFileUsed(), " run wait &")
hkCmd := fmt.Sprint("export ", dpEnv, "; exec ", exe, config, " run wait &")
execArgs = append(execArgs, "sh", "-c", hkCmd)

execStr := fmt.Sprint(execName, " ", strings.Join(execArgs, " "))
Expand Down

0 comments on commit 7f84829

Please sign in to comment.