only copy on confirm (#23)

pull/26/head
Marcus Kok 2 years ago committed by GitHub
parent 35aeeb0f7d
commit e5f82cb724
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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

Loading…
Cancel
Save