Merge pull request #3398 from logan-arens/update-1934

"beet update" now confirms that the library path exists before updating.
This commit is contained in:
Adrian Sampson 2019-10-12 14:15:32 -04:00 committed by GitHub
commit bf9b43a769
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 0 deletions

View file

@ -1185,6 +1185,12 @@ def update_items(lib, query, album, move, pretend, fields):
def update_func(lib, opts, args):
# Verify that the library folder exists to prevent accidental wipes.
if not os.path.isdir(lib.directory):
ui.print_("Library path is unavailable or does not exist.")
ui.print_(lib.directory)
if not ui.input_yn("Are you sure you want to continue (y/n)?", True):
return
update_items(lib, decargs(args), opts.album, ui.should_move(opts.move),
opts.pretend, opts.fields)

View file

@ -116,6 +116,11 @@ Fixes:
:bug:`3242`
* Fix a bug that caused a crash when tagging items with the beatport plugin.
:bug:`3374`
* ``beet update`` will now confirm that the user still wants to update if
their library folder cannot be found, preventing the user from accidentally
wiping out their beets database.
Thanks to :user:`logan-arens`.
:bug:`1934`
For plugin developers: