Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions beets/ui/commands/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,19 @@
"""
path = cli_options.config or config.user_config_path()
editor = editor_command()

if not editor:
raise ui.UserError(
"Please set the VISUAL or EDITOR environment variable to edit configuration."

Check failure on line 56 in beets/ui/commands/config.py

View workflow job for this annotation

GitHub Actions / Check linting

Ruff (E501)

beets/ui/commands/config.py:56:89: E501 Line too long (89 > 88)
)
try:
if not os.path.isfile(path):
open(path, "w+").close()
interactive_open([path], editor)
except FileNotFoundError:
raise ui.UserError(f"Editor {editor!r} not found.")
except OSError as exc:
message = f"Could not edit configuration: {exc}"
if not editor:
message += (
". Please set the VISUAL (or EDITOR) environment variable"
)
raise ui.UserError(message)
raise ui.UserError(f"Could not edit configuration: {exc}")


config_cmd = ui.Subcommand("config", help="show or edit the user configuration")
Expand Down
2 changes: 2 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ Bug fixes
backends, such as ``mp3gain``. :bug:`2946`
- :doc:`plugins/mbpseudo`: Fix crash due to missing ``artist_credit`` field in
the MusicBrainz API response. :bug:`6339`
- :ref:`config-cmd`: Improved error message when user-configured editor does not
exist. :bug:`6176`

..
For plugin developers
Expand Down
Loading