From b373f0a1b916b65c3687ae63f7f4a916f9933223 Mon Sep 17 00:00:00 2001 From: Jordan Atwood Date: Thu, 1 Jun 2023 16:05:46 -0700 Subject: [PATCH] Fail music transfer when local file lookup fails Prior to this change, a transfer file with missing directories and files would silently go on without any kind of notice that these files were not included. To ensure the file is up-to-date with any name changes or misspellings of source files, these should cause an error and halt prior to transfer. --- src/.bin/music-transfer.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/.bin/music-transfer.py b/src/.bin/music-transfer.py index 3aad90f..d5e6cba 100755 --- a/src/.bin/music-transfer.py +++ b/src/.bin/music-transfer.py @@ -78,6 +78,9 @@ for line in open(paths_file, 'r'): source_files.add(file_path) else: print(f'[TRACE] Unknown file extension of entry: {file}', file=sys.stderr) + elif not path.exists(): + print(f'[ERROR] Could not find source path: {path}') + sys.exit(3) if len(source_files) == 0: print('No source files to transfer')