fix captplanet and satellite overwrite flags (#516)
* fix captplanet and satellite overwrite flags
This commit is contained in:
parent
a61de403d7
commit
94128d63a1
@ -58,6 +58,12 @@ func cmdSetup(cmd *cobra.Command, args []string) (err error) {
|
||||
if !setupCfg.Overwrite && err == nil {
|
||||
fmt.Println("A captplanet configuration already exists. Rerun with --overwrite")
|
||||
return nil
|
||||
} else if setupCfg.Overwrite && err == nil {
|
||||
fmt.Println("overwriting existing captplanet config")
|
||||
err = os.RemoveAll(setupCfg.BasePath)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
hcPath := filepath.Join(setupCfg.BasePath, "satellite")
|
||||
|
@ -92,6 +92,12 @@ func cmdSetup(cmd *cobra.Command, args []string) (err error) {
|
||||
if !setupCfg.Overwrite && err == nil {
|
||||
fmt.Println("An satellite configuration already exists. Rerun with --overwrite")
|
||||
return nil
|
||||
} else if setupCfg.Overwrite && err == nil {
|
||||
fmt.Println("overwriting existing satellite config")
|
||||
err = os.RemoveAll(setupCfg.BasePath)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
err = os.MkdirAll(setupCfg.BasePath, 0700)
|
||||
|
Loading…
Reference in New Issue
Block a user