island: Find MONKEY_ISLAND_ABS_PATH by __file__ instead of os.getcwd()

We can't be sure what $PWD is when Monkey Island is started.
This commit is contained in:
Mike Salvatore 2021-06-01 19:40:11 -04:00
parent 184594f509
commit a8570987a6
1 changed files with 2 additions and 1 deletions

View File

@ -1,4 +1,5 @@
import os
from pathlib import Path
from monkey_island.cc.environment.utils import is_windows_os
@ -14,7 +15,7 @@ def get_default_data_dir() -> str:
SERVER_CONFIG_FILENAME = "server_config.json"
MONKEY_ISLAND_ABS_PATH = os.path.join(os.getcwd(), "monkey_island")
MONKEY_ISLAND_ABS_PATH = str(Path(__file__).resolve().parent.parent.parent)
DEFAULT_DATA_DIR = os.path.expandvars(get_default_data_dir())