diff --git a/beets/ui/commands.py b/beets/ui/commands.py index 7941be46b..56f9ad1f5 100755 --- a/beets/ui/commands.py +++ b/beets/ui/commands.py @@ -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) diff --git a/docs/changelog.rst b/docs/changelog.rst index 963863ae8..16d5f7d1c 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -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: