Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: Wrong path edited when running config -e #5685

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Alch-Emi
Copy link
Contributor

@Alch-Emi Alch-Emi commented Mar 23, 2025

As per #5652, beet --config <path> config -e edited the default config path, even though that's not the config that would be used by beets.

It seems like this was the result of a deliberate short-circuit in _raw_main(). The short-circuit prevents malformed configs from causing a crash before opening the editor, but also prevents the setup function from loading the custom config at all.

The solution used here is to just expose the CLI options to edit_config(), so that it can use the custom config path if its set. I also suspect that the branch in config_func() which is getting short circuited is actually unreachable, but I left it in with a note just in case.

Fixes #5652

To Do

  • Documentation (N/A)
  • Changelog
  • Tests

Previously: ALWAYS edited the default config path
Corrected: When the --config <path> option is used, that path is edited
@Alch-Emi Alch-Emi force-pushed the edit-custom-config branch from 434280e to 4a43191 Compare March 23, 2025 19:58
@Alch-Emi
Copy link
Contributor Author

Oops, I thought I checked that. (force-push to fix formatting)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

config -e edits the wrong file
1 participant