File tree Expand file tree Collapse file tree
internal/namespaces/object/v1 Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -83,15 +83,18 @@ func configInstallCommand() *core.Command {
8383
8484 // Ask whether to remove previous configuration file if it exists
8585 if _ , err := os .Stat (configPath ); err == nil {
86- _ , err := interactive .PromptBoolWithConfig (& interactive.PromptBoolConfig {
86+ doIt , err := interactive .PromptBoolWithConfig (& interactive.PromptBoolConfig {
8787 Prompt : "Do you want to overwrite the existing configuration file (" + configPath + ")?" ,
8888 DefaultValue : false ,
8989 })
9090 if err != nil {
9191 return nil , err
9292 }
93+ if ! doIt {
94+ return "Installation aborted by user" , nil
95+ }
9396 }
94- err = ioutil .WriteFile (configPath , []byte (newConfig ), 0644 )
97+ err = ioutil .WriteFile (configPath , []byte (newConfig ), 0600 )
9598 if err != nil {
9699 return "" , err
97100 }
You can’t perform that action at this time.
0 commit comments