File size: 690 Bytes
b5ba7a5 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
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'")
os.system(command)
|