Skip to content

Commit

Permalink
sync_music: Create destination directory
Browse files Browse the repository at this point in the history
Create the destination directory when reading the settings. This
improves usability as the user doesn't have to enter a destination
directory that fully exists.

If there are no input files or if program aborts due to any reason
the created directory stays empty on the disk and is not deleted.
  • Loading branch information
fetzerch committed Oct 18, 2015
1 parent fe89b21 commit 6ff699e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions sync_music/sync_music.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,9 @@ def load_settings(arguments=None):
if settings.playlist_src is not None:
paths.append('playlist_src')
settings_dict = vars(settings)
if settings_dict['audio_dest']:
util.ensure_directory_exists(
util.makepath(settings_dict['audio_dest']))
for path in paths:
settings_dict[path] = util.makepath(settings_dict[path])
if not os.path.isdir(settings_dict[path]):
Expand Down

0 comments on commit 6ff699e

Please sign in to comment.