feat(config): warn_on_delete, warn_on_overwrite, display_art toggles in config

This commit is contained in:
Lewis Wynne 2025-12-18 13:30:38 +00:00
parent 62c770dbf3
commit 6efa9863fe
5 changed files with 43 additions and 19 deletions

View file

@ -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 {