mirror of
https://github.com/beetbox/beets.git
synced 2026-01-30 12:02:41 +01:00
beet config (#552): show non-existent user path
This makes sure to print out the user's configuration path location even if no user config file exists. (This makes "BEETSCONFIG=xxx beet config -p" behave as expected, for instance.) It's a little hacky. Does the approach make sense to you, @geigerzaehler?
This commit is contained in:
parent
f0c0b5c54b
commit
86bf8b65ba
1 changed files with 11 additions and 1 deletions
|
|
@ -1265,11 +1265,21 @@ def config_func(lib, opts, args):
|
|||
|
||||
# Print paths.
|
||||
if opts.paths:
|
||||
filenames = []
|
||||
for source in config.sources:
|
||||
if not opts.defaults and source.default:
|
||||
continue
|
||||
if source.filename:
|
||||
print(source.filename)
|
||||
filenames.append(source.filename)
|
||||
|
||||
# In case the user config file does not exist, prepend it to the
|
||||
# list.
|
||||
user_path = config.user_config_path()
|
||||
if user_path not in filenames:
|
||||
filenames.insert(0, user_path)
|
||||
|
||||
for filename in filenames:
|
||||
print(filename)
|
||||
|
||||
# Open in editor.
|
||||
elif opts.edit:
|
||||
|
|
|
|||
Loading…
Reference in a new issue