diff --git a/beets/ui/commands.py b/beets/ui/commands.py index 76473e678..bbdbbcf96 100644 --- a/beets/ui/commands.py +++ b/beets/ui/commands.py @@ -1482,11 +1482,13 @@ def config_func(lib, opts, args): def config_edit(): """Open a program to edit the user configuration. + An empty config file is created if no existing config file exists. """ path = config.user_config_path() - editor = os.environ.get('EDITOR') try: + if not os.path.isfile(path): + open(path, 'w+').close() util.interactive_open(path, editor) except OSError as exc: message = "Could not edit configuration: {0}".format(exc)