Files
chrisgoringe-cg-use-everywhere/install.py
T
2023-09-30 10:49:48 +10:00

18 lines
702 B
Python

import os, git, sys
sys.path.insert(0,os.path.join(os.path.dirname(os.path.realpath(__file__)),"..",".."))
repo_url = 'https://github.com/chrisgoringe/cg-custom-core.git/'
repo_path = os.path.join(os.getcwd(),"..","cg_custom_core")
if os.path.exists(os.path.join(repo_path, '.git')):
print("Updating cg_custom_nodes")
repo:git.Repo = git.Repo(repo_path)
origin = repo.remote(name='origin')
origin.pull(rebase=True)
repo.git.submodule('update','--init','--recursive')
repo.close()
else:
print("Installing cg_custom_nodes")
repo = git.Repo.clone_from(repo_url, repo_path)
repo.git.clear_cache()
repo.git.submodule('update','--init','--recursive')
repo.close()