Skip to content
Snippets Groups Projects
Commit 507af768 authored by ale's avatar ale
Browse files

do not die if the music_dir does not exist, just report an error

parent 65bc61ec
Branches
No related tags found
No related merge requests found
......@@ -55,6 +55,10 @@ def run_client(server_url, music_dir, api_key, run_once, bwlimit, enable_watcher
if bwlimit:
throttle.set_rate_limit(bwlimit)
# Warn on this condition, but don't die -- the directory might exist later!
if not os.path.isdir(music_dir):
log.error('The music_dir you specified does not exist')
if enable_watcher and not watcher_support:
log.warn('inotify/fsevents support not enabled on this platform')
enable_watcher = False
......@@ -128,8 +132,8 @@ def main():
opts, args = parser.parse_args()
if not opts.api_key:
parser.error('You must specify an API Key')
if not os.path.isdir(opts.music_dir):
parser.error('The --music_dir you specified does not exist')
music_dir = os.path.expanduser(opts.music_dir)
if args:
parser.error('Too many arguments')
......@@ -142,7 +146,7 @@ def main():
do_realtime = not opts.no_realtime_watch
daemonize.daemonize(opts, run_client,
(opts.server_url, opts.music_dir, opts.api_key,
(opts.server_url, music_dir, opts.api_key,
opts.once, opts.bwlimit, do_realtime))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment