Skip to content

Commit 2329b4c

Browse files
temporarily add auto appium nodejs install (#613)
1 parent 9149f56 commit 2329b4c

1 file changed

Lines changed: 18 additions & 18 deletions

File tree

node_cli.py

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -38,20 +38,11 @@
3838
from Framework.install_handler.long_poll_handler import InstallHandler
3939
from server.mobile import upload_android_ui_dump
4040

41-
print(
42-
f"Python {platform.python_version()} ({platform.architecture()[0]}) @ {sys.executable}"
43-
)
44-
print(f"Current file path: {os.path.abspath(__file__)}")
45-
46-
4741
def adjust_python_path():
4842
"""Adjusts the Python path to include the Framework directory."""
49-
root_dir = Path.cwd()
43+
root_dir = Path(__file__).parent
5044
framework_dir = root_dir / "Framework"
5145

52-
automation_log_dir = root_dir / "AutomationLog"
53-
automation_log_dir.mkdir(exist_ok=True)
54-
5546
# Append correct paths so that it can find the configuration files and other modules
5647
sys.path.append(str(framework_dir))
5748

@@ -1215,17 +1206,26 @@ async def set_new_credentials(server, api_key):
12151206
ConfigModule.remove_config_value(AUTHENTICATION_TAG, "server_address")
12161207
ConfigModule.add_config_value(AUTHENTICATION_TAG, "server_address", server)
12171208

1209+
def print_system_info_version():
1210+
"""Prints the system information and version of the Node"""
1211+
print(
1212+
f"Python {platform.python_version()} ({platform.architecture()[0]}) @ {sys.executable}"
1213+
)
1214+
print(f"Current file path: {os.path.abspath(__file__)}")
1215+
1216+
12181217
def create_temp_ini_automation_log():
12191218
global TMP_INI_FILE
1220-
TMP_INI_FILE = (
1221-
Path.cwd()
1222-
/ "AutomationLog"
1223-
/ ConfigModule.get_config_value("Advanced Options", "_file")
1224-
)
1225-
Path(TMP_INI_FILE).parent.mkdir(parents=True, exist_ok=True)
1219+
1220+
root_dir = Path(__file__).parent
1221+
automation_log_dir = root_dir / "AutomationLog"
1222+
automation_log_dir.mkdir(exist_ok=True)
1223+
print(f"Created AutomationLog directory at {automation_log_dir}")
1224+
1225+
TMP_INI_FILE = automation_log_dir / ConfigModule.get_config_value("Advanced Options", "_file")
12261226

12271227
async def main():
1228-
# Load environment variables from .env file
1228+
print_system_info_version()
12291229
load_dotenv()
12301230
adjust_python_path()
12311231
ConfigModule.remove_settings_lock_file()
@@ -1249,7 +1249,7 @@ async def main():
12491249
check_min_python_version(min_python_version="3.11", show_warning=True)
12501250

12511251
# Setup Node.js and Appium before other operations
1252-
# setup_nodejs_appium()
1252+
setup_nodejs_appium()
12531253

12541254
update_outdated_modules()
12551255
asyncio.create_task(start_server())

0 commit comments

Comments
 (0)