only copy on confirm

pull/23/head
Marcusk19 2 years ago
parent 35aeeb0f7d
commit dd37781910

@ -61,14 +61,12 @@ func runAddCommand(cmd *cobra.Command, args []string) {
IsConfirm: true, IsConfirm: true,
} }
overwrite, _ := confirm.Run() overwrite, _ := confirm.Run()
if strings.ToUpper(overwrite) != "Y" { if strings.ToUpper(overwrite) == "Y" {
return
}
}
err = tools.CopyDir(fs, configSrc, dotfileDest) err = tools.CopyDir(fs, configSrc, dotfileDest)
if err != nil { if err != nil {
log.Fatal(err) log.Fatal(err)
} }
fmt.Printf("Copied %s -> %s\n", configSrc, dotfileDest) fmt.Printf("Copied %s -> %s\n", configSrc, dotfileDest)
} }
}
}

Loading…
Cancel
Save