Skip to content

Commit

Permalink
Merge pull request efroemling#34 from Awesome-Logic/patch-1
Browse files Browse the repository at this point in the history
Added os.chdir() in ballistica_server.py
  • Loading branch information
efroemling authored May 7, 2020
2 parents 233a4a4 + 7b50b1e commit e14a95f
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions assets/src/server/ballisticacore_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,26 +22,31 @@
"""BallisticaCore server manager."""
from __future__ import annotations

import sys
import os
import json
import os
import subprocess
import sys
import time
from threading import Thread, Lock, current_thread
from pathlib import Path
from threading import Lock, Thread, current_thread
from typing import TYPE_CHECKING

from bacommon.servermanager import ServerConfig, StartServerModeCommand
from efro.dataclasses import dataclass_assign, dataclass_validate
from efro.error import CleanError
from efro.terminal import Clr

# We change our working directory according to file's path
# so that the script can be properly executed from anywhere
os.chdir(os.path.abspath(os.path.dirname(__file__)))

# We make use of the bacommon and efro packages as well as site-packages
# included with our bundled Ballistica dist.
sys.path += [
str(Path(os.getcwd(), 'dist', 'ba_data', 'python')),
str(Path(os.getcwd(), 'dist', 'ba_data', 'python-site-packages'))
]

from efro.terminal import Clr
from efro.error import CleanError
from efro.dataclasses import dataclass_assign, dataclass_validate
from bacommon.servermanager import (ServerConfig, StartServerModeCommand)

if TYPE_CHECKING:
from typing import Optional, List, Dict, Union, Tuple
Expand Down

0 comments on commit e14a95f

Please sign in to comment.