mirror of
https://github.com/morpheus65535/bazarr.git
synced 2025-01-11 01:07:36 +08:00
Check for user home directory while installing requirements.
Fix infinite rebooting, if user doesn't have home directory.
This commit is contained in:
parent
216d10a90a
commit
88d1a63b1c
1 changed files with 16 additions and 13 deletions
|
@ -54,20 +54,23 @@ if not args.no_update:
|
|||
except ImportError:
|
||||
logging.info('BAZARR unable to install requirements (pip not installed).')
|
||||
else:
|
||||
logging.info('BAZARR installing requirements...')
|
||||
subprocess.call([sys.executable, '-m', 'pip', 'install', '--user', '-r',
|
||||
os.path.join(os.path.dirname(__file__), '..', 'requirements.txt')],
|
||||
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||
logging.info('BAZARR requirements installed.')
|
||||
try:
|
||||
restart_file = io.open(os.path.join(args.config_dir, "bazarr.restart"), "w", encoding='UTF-8')
|
||||
except Exception as e:
|
||||
logging.error('BAZARR Cannot create bazarr.restart file: ' + repr(e))
|
||||
if os.path.expanduser("~") == '/':
|
||||
logging.info('BAZARR unable to install requirements (user without home directory).')
|
||||
else:
|
||||
logging.info('Bazarr is being restarted...')
|
||||
restart_file.write(str(''))
|
||||
restart_file.close()
|
||||
os._exit(0)
|
||||
logging.info('BAZARR installing requirements...')
|
||||
subprocess.call([sys.executable, '-m', 'pip', 'install', '--user', '-r',
|
||||
os.path.join(os.path.dirname(__file__), '..', 'requirements.txt')],
|
||||
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||
logging.info('BAZARR requirements installed.')
|
||||
try:
|
||||
restart_file = io.open(os.path.join(args.config_dir, "bazarr.restart"), "w", encoding='UTF-8')
|
||||
except Exception as e:
|
||||
logging.error('BAZARR Cannot create bazarr.restart file: ' + repr(e))
|
||||
else:
|
||||
logging.info('Bazarr is being restarted...')
|
||||
restart_file.write(str(''))
|
||||
restart_file.close()
|
||||
os._exit(0)
|
||||
|
||||
# create random api_key if there's none in config.ini
|
||||
if not settings.auth.apikey or settings.auth.apikey.startswith("b'"):
|
||||
|
|
Loading…
Reference in a new issue