From 86bf8b65bad0df8d1d2f62994c0f9af241850357 Mon Sep 17 00:00:00 2001 From: Adrian Sampson Date: Fri, 28 Feb 2014 14:31:38 -0800 Subject: [PATCH] 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? --- beets/ui/commands.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/beets/ui/commands.py b/beets/ui/commands.py index 68efb16b7..f4d30feb1 100644 --- a/beets/ui/commands.py +++ b/beets/ui/commands.py @@ -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: