-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathinstall.py
More file actions
25 lines (22 loc) · 862 Bytes
/
install.py
File metadata and controls
25 lines (22 loc) · 862 Bytes
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
import sys
import os
from modules import scripts
git = os.environ.get('GIT', "git")
usefulDirs = sys.argv[0].split(os.sep)[-3:]
installDir = os.path.join(scripts.basedir(), usefulDirs[0], usefulDirs[1])
# Attempt to use launch module from webui
command = f'"{git}" -C "' + installDir +\
'" submodule update --init --recursive --remote'
if not os.path.isfile(os.path.join(installDir, "app", "index.html")):
try:
from launch import run
stdout = run(command)
if stdout is not None:
print(stdout)
except ImportError:
print("[openoutpaint-extension] We failed to import the 'launch' module. Using 'os'")
try:
os.system(command)
except:
# TODO: find exception type
print(f"[openOutpaint-extension-submodule] failed to download update, check network")