Make server auto-reload work win run-local

This commit is contained in:
Kovid Goyal 2019-04-17 08:49:39 +05:30
parent 14a8056a3c
commit 953eb7029d
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -402,6 +402,8 @@ def auto_reload(log, dirs=frozenset(), cmd=None, add_default_dirs=True, listen_o
if cmd is None:
cmd = list(sys.argv)
cmd.remove('--auto-reload')
if os.path.basename(cmd[0]) == 'run-local':
cmd.insert(1, 'calibre-server')
dirs = find_dirs_to_watch(fpath, dirs, add_default_dirs)
log('Auto-restarting server on changes press Ctrl-C to quit')
log('Watching %d directory trees for changes' % len(dirs))