Add try/except for not finding run file

This commit is contained in:
Andrew 2022-12-21 21:55:21 -05:00
parent af10353119
commit d5cc4529b0

View File

@ -587,6 +587,7 @@ class ServerInstance:
# We need to grab the exact forge version number.
# We know we can find it here in the run.sh/bat script.
try:
run_file_path = ""
if self.helper.is_os_windows():
run_file_path = os.path.join(server_obj.path, "run.bat")
@ -621,13 +622,17 @@ class ServerInstance:
)
# Now lets set up the new run command.
# This is based off the run.sh/bat that
# Forge uses in 1.16 and <
# Forge uses in 1.17 and <
execution_command = (
f"java @{server_command[0]}"
f" @{executable_path}{server_command[3]} nogui {server_command[4]}"
f" @{executable_path}{server_command[3]} nogui"
" {server_command[4]}"
)
server_obj.execution_command = execution_command
Console.debug("SUCCESS! Forge install completed")
except:
logger.debug("Could not find run file.")
# TODO Use regex to get version and rebuild simple execution
# We'll update the server with the new information now.
HelperServers.update_server(server_obj)