-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Expand file tree
/
Copy pathstart-abus.py
More file actions
50 lines (36 loc) · 1.37 KB
/
start-abus.py
File metadata and controls
50 lines (36 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import argparse
import os
import sys
import shutil
from pathlib import Path
from one_click import *
if __name__ == '__main__':
if len(sys.argv) < 2:
print("Usage: python start-abus.py <app_name>")
sys.exit(1)
OneClick.oc_check_env()
app_name = sys.argv[1]
print(f"app_name: {app_name}")
is_update = True if len(sys.argv) == 3 and sys.argv[2] == '--update' else False
is_installed = OneClick.oc_is_installed()
# Debug: Print installation status
print(f"Installation check: is_installed={is_installed}, is_update={is_update}")
# check start-appname.py
python_filename = f'start-{app_name}.py'
if not os.path.exists(python_filename):
print(f"File not found - {python_filename}")
sys.exit(1)
if not is_installed:
print("Starting installation process...")
OneClick.oc_install_webui(app_name, False)
# oc_install_extra_packages(app_name)
elif is_update:
print("Starting update process...")
OneClick.oc_install_webui(app_name, True)
# oc_install_extra_packages(app_name)
else:
print("Skipping installation (already installed).")
# ABUS - start
if not is_update:
print("Start the program...")
OneClick.oc_run_cmd(f"python {python_filename}", environment=True)