feat: git_exe settings

This commit is contained in:
Dr.Lt.Data
2023-09-20 21:39:04 +09:00
parent 3edb3586b7
commit c2ae252e41
5 changed files with 54 additions and 6 deletions

View File

@@ -1,6 +1,9 @@
import sys
import os
import git
import configparser
config_path = os.path.join(os.path.dirname(__file__), "config.ini")
def gitclone(custom_nodes_path, url):
repo_name = os.path.splitext(os.path.basename(url))[0]
@@ -72,6 +75,17 @@ def gitpull(path):
repo.close()
def setup_environment():
config = configparser.ConfigParser()
config.read(config_path)
if 'git_exe' in config['default'] and config['default']['git_exe'] != '':
git.Git().update_environment(GIT_PYTHON_GIT_EXECUTABLE=config['default']['git_exe'])
setup_environment()
try:
if sys.argv[1] == "--clone":
gitclone(sys.argv[2], sys.argv[3])