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.
master
Jordan Atwood 1 year ago
parent 564979b0c7
commit b373f0a1b9
Signed by: nightfirecat
GPG Key ID: 615A619C2D73A6DF
  1. 3
      src/.bin/music-transfer.py

@ -78,6 +78,9 @@ for line in open(paths_file, 'r'):
source_files.add(file_path) source_files.add(file_path)
else: else:
print(f'[TRACE] Unknown file extension of entry: {file}', file=sys.stderr) 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: if len(source_files) == 0:
print('No source files to transfer') print('No source files to transfer')

Loading…
Cancel
Save