Bugfix for live server windows support

This commit is contained in:
Sven Heidemann 2021-03-31 11:41:16 +02:00
parent 33cb35e26f
commit df87d08be3

View File

@ -51,8 +51,12 @@ class LiveServerThread(threading.Thread):
Console.set_foreground_color(ForegroundColorEnum.default) Console.set_foreground_color(ForegroundColorEnum.default)
env_vars = os.environ env_vars = os.environ
env_vars['PYTHONPATH'] = f'{os.path.dirname(self._path)}:' \ if sys.platform == 'win32':
f'{os.path.join(os.path.dirname(self._path), self._build_settings.source_path)}' env_vars['PYTHONPATH'] = f'{os.path.dirname(self._path)};' \
f'{os.path.join(os.path.dirname(self._path), self._build_settings.source_path)}'
else:
env_vars['PYTHONPATH'] = f'{os.path.dirname(self._path)}:' \
f'{os.path.join(os.path.dirname(self._path), self._build_settings.source_path)}'
self._command = [sys.executable, self._main, ''.join(sys.argv[2:])] self._command = [sys.executable, self._main, ''.join(sys.argv[2:])]
subprocess.run(self._command, env=env_vars) subprocess.run(self._command, env=env_vars)