Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
remyleone committed Apr 22, 2020
1 parent d6afa27 commit 6b5952d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions internal/namespaces/object/v1/custom_config_install.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,18 @@ func configInstallCommand() *core.Command {

// Ask whether to remove previous configuration file if it exists
if _, err := os.Stat(configPath); err == nil {
_, err := interactive.PromptBoolWithConfig(&interactive.PromptBoolConfig{
doIt, err := interactive.PromptBoolWithConfig(&interactive.PromptBoolConfig{
Prompt: "Do you want to overwrite the existing configuration file (" + configPath + ")?",
DefaultValue: false,
})
if err != nil {
return nil, err
}
if !doIt {
return "Installation aborted by user", nil
}
}
err = ioutil.WriteFile(configPath, []byte(newConfig), 0644)
err = ioutil.WriteFile(configPath, []byte(newConfig), 0600)
if err != nil {
return "", err
}
Expand Down

0 comments on commit 6b5952d

Please sign in to comment.