mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2025-01-19 01:35:28 +01:00
Add env parameter to popen
This commit is contained in:
parent
e3669a2483
commit
b6b8a1c14a
@ -241,11 +241,12 @@ class Server:
|
|||||||
logger.info(f"Starting server in {self.server_path} with command: {self.server_command}")
|
logger.info(f"Starting server in {self.server_path} with command: {self.server_command}")
|
||||||
|
|
||||||
if not helper.is_os_windows() and servers_helper.get_server_type_by_id(self.server_id) == "minecraft-bedrock":
|
if not helper.is_os_windows() and servers_helper.get_server_type_by_id(self.server_id) == "minecraft-bedrock":
|
||||||
|
print("in catch")
|
||||||
my_env = os.environ
|
my_env = os.environ
|
||||||
my_env["PATH"] = 'LD_LIBRARY_PATH='+self.server_path
|
my_env["PATH"] = 'LD_LIBRARY_PATH='+self.server_path
|
||||||
try:
|
try:
|
||||||
self.process = subprocess.Popen(
|
self.process = subprocess.Popen(
|
||||||
self.server_command, cwd=self.server_path, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
self.server_command, cwd=self.server_path, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, env=my_env)
|
||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
#Checks for java on initial fail
|
#Checks for java on initial fail
|
||||||
if os.system("java -version") == 32512:
|
if os.system("java -version") == 32512:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user