From 6ff699e46d11ac2fd635cae548fba14a4b8cd46c Mon Sep 17 00:00:00 2001 From: Christian Fetzer Date: Sat, 17 Oct 2015 23:54:36 +0200 Subject: [PATCH] sync_music: Create destination directory 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. --- sync_music/sync_music.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sync_music/sync_music.py b/sync_music/sync_music.py index aef46af..4ffc3bb 100644 --- a/sync_music/sync_music.py +++ b/sync_music/sync_music.py @@ -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]):