Update main.py
Browse files
main.py
CHANGED
@@ -117,7 +117,7 @@ def clone_repos_sd(repo_urls, clone_dir='/tmp/code/sd/stable-diffusion-webui/ext
|
|
117 |
clone_dir (str): 克隆仓库的目标目录
|
118 |
"""
|
119 |
# 创建目标目录
|
120 |
-
os.makedirs(clone_dir, exist_ok=True)
|
121 |
for repo_url in repo_urls:
|
122 |
try:
|
123 |
repo_name = repo_url.rstrip('/').split('/')[-1]
|
@@ -125,13 +125,12 @@ def clone_repos_sd(repo_urls, clone_dir='/tmp/code/sd/stable-diffusion-webui/ext
|
|
125 |
if os.path.exists(clone_path):
|
126 |
print(f'仓库 {repo_name} 已存在, URL: {repo_url}')
|
127 |
continue
|
128 |
-
|
129 |
-
subprocess.run(['git', 'clone', repo_url, clone_path], check=True)
|
130 |
print(f'已成功克隆仓库: {repo_name}')
|
131 |
-
except
|
132 |
print(f'克隆 {repo_url} 失败: {e}')
|
133 |
def clone_repos_comfyui(repo_urls, clone_dir='/tmp/code/sd/ComfyUI/custom_nodes'):
|
134 |
-
os.makedirs(clone_dir, exist_ok=True)
|
135 |
for repo_url in repo_urls:
|
136 |
try:
|
137 |
repo_name = repo_url.rstrip('/').split('/')[-1]
|
@@ -139,10 +138,9 @@ def clone_repos_comfyui(repo_urls, clone_dir='/tmp/code/sd/ComfyUI/custom_nodes'
|
|
139 |
if os.path.exists(clone_path):
|
140 |
print(f'仓库 {repo_name} 已存在, URL: {repo_url}')
|
141 |
continue
|
142 |
-
|
143 |
-
subprocess.run(['git', 'clone', repo_url, clone_path], check=True)
|
144 |
print(f'已成功克隆仓库: {repo_name}')
|
145 |
-
except
|
146 |
print(f'克隆 {repo_url} 失败: {e}')
|
147 |
|
148 |
clone_repos_sd(git_sd)
|
|
|
117 |
clone_dir (str): 克隆仓库的目标目录
|
118 |
"""
|
119 |
# 创建目标目录
|
120 |
+
os.makedirs(clone_dir, exist_ok=True, mode=0o755)
|
121 |
for repo_url in repo_urls:
|
122 |
try:
|
123 |
repo_name = repo_url.rstrip('/').split('/')[-1]
|
|
|
125 |
if os.path.exists(clone_path):
|
126 |
print(f'仓库 {repo_name} 已存在, URL: {repo_url}')
|
127 |
continue
|
128 |
+
os.system(f'git clone {repo_url} {clone_path}')
|
|
|
129 |
print(f'已成功克隆仓库: {repo_name}')
|
130 |
+
except Exception as e:
|
131 |
print(f'克隆 {repo_url} 失败: {e}')
|
132 |
def clone_repos_comfyui(repo_urls, clone_dir='/tmp/code/sd/ComfyUI/custom_nodes'):
|
133 |
+
os.makedirs(clone_dir, exist_ok=True, mode=0o755)
|
134 |
for repo_url in repo_urls:
|
135 |
try:
|
136 |
repo_name = repo_url.rstrip('/').split('/')[-1]
|
|
|
138 |
if os.path.exists(clone_path):
|
139 |
print(f'仓库 {repo_name} 已存在, URL: {repo_url}')
|
140 |
continue
|
141 |
+
os.system(f'git clone {repo_url} {clone_path}')
|
|
|
142 |
print(f'已成功克隆仓库: {repo_name}')
|
143 |
+
except Exception as e:
|
144 |
print(f'克隆 {repo_url} 失败: {e}')
|
145 |
|
146 |
clone_repos_sd(git_sd)
|