mirror of
https://github.com/beetbox/beets.git
synced 2025-12-15 21:14:19 +01:00
Don't rename the config file if there is nothing to migrate from
This commit is contained in:
parent
31d1d90e4c
commit
5015f6a21d
1 changed files with 9 additions and 7 deletions
|
|
@ -251,6 +251,15 @@ def migrate_config(replace=False):
|
|||
config.yaml will be moved aside. Otherwise, the process is aborted
|
||||
when the file exists.
|
||||
"""
|
||||
|
||||
# Load legacy configuration data, if any.
|
||||
config, configpath = get_config()
|
||||
if not config:
|
||||
log.debug(u'no config file found at {0}'.format(
|
||||
util.displayable_path(configpath)
|
||||
))
|
||||
return
|
||||
|
||||
# Get the new configuration file path and possibly move it out of
|
||||
# the way.
|
||||
destfn = os.path.join(beets.config.config_dir(), confit.CONFIG_FILENAME)
|
||||
|
|
@ -264,13 +273,6 @@ def migrate_config(replace=False):
|
|||
# File exists and we won't replace it. We're done.
|
||||
return
|
||||
|
||||
# Load legacy configuration data, if any.
|
||||
config, configpath = get_config()
|
||||
if not config:
|
||||
log.debug(u'no config file found at {0}'.format(
|
||||
util.displayable_path(configpath)
|
||||
))
|
||||
return
|
||||
log.debug(u'migrating config file {0}'.format(
|
||||
util.displayable_path(configpath)
|
||||
))
|
||||
|
|
|
|||
Loading…
Reference in a new issue