Skip to content

Commit

Permalink
Merge pull request #3398 from logan-arens/update-1934
Browse files Browse the repository at this point in the history
"beet update" now confirms that the library path exists before updating.
  • Loading branch information
sampsyo authored Oct 12, 2019
2 parents 99569ec + b2ef194 commit bf9b43a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
6 changes: 6 additions & 0 deletions beets/ui/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
5 changes: 5 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down

0 comments on commit bf9b43a

Please sign in to comment.