feat(config): warn_on_delete, warn_on_overwrite, display_art toggles in config
This commit is contained in:
parent
62c770dbf3
commit
6efa9863fe
5 changed files with 43 additions and 19 deletions
|
|
@ -70,7 +70,7 @@ func mv(cmd *cobra.Command, args []string) error {
|
|||
readonly: false,
|
||||
sync: false,
|
||||
transact: func(tx *badger.Txn, k []byte) error {
|
||||
if !force {
|
||||
if !force && config.WarnOnOverwrite {
|
||||
if _, err := tx.Get(k); err == nil {
|
||||
return fmt.Errorf("cannot move '%s': '%s' already exists > run with --force to overwrite", fromSpec.Key, toSpec.Key)
|
||||
} else if err != badger.ErrKeyNotFound {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue