Update app.py
Browse files
app.py
CHANGED
@@ -1,25 +1,20 @@
|
|
1 |
import subprocess
|
2 |
-
import
|
3 |
|
4 |
def clone_github_repo(repo_url, destination_folder=None):
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
:param repo_url: クローンするリポジトリのURL
|
9 |
-
:param destination_folder: 保存先フォルダのパス(指定しない場合、リポジトリ名が使用されます)
|
10 |
-
"""
|
11 |
try:
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
# git clone コマンドを実行
|
17 |
-
subprocess.run(["git", "clone", repo_url, destination_folder], check=True)
|
18 |
-
print(f"リポジトリ {repo_url} を {destination_folder} にクローンしました。")
|
19 |
except subprocess.CalledProcessError as e:
|
20 |
-
|
|
|
|
|
|
|
|
|
|
|
21 |
|
22 |
-
|
23 |
-
repo_url
|
24 |
-
clone_github_repo(repo_url)
|
25 |
-
gradio.load()
|
|
|
1 |
import subprocess
|
2 |
+
import streamlit as st
|
3 |
|
4 |
def clone_github_repo(repo_url, destination_folder=None):
|
5 |
+
if destination_folder is None:
|
6 |
+
destination_folder = repo_url.split('/')[-1].replace('.git', '')
|
|
|
|
|
|
|
|
|
7 |
try:
|
8 |
+
result = subprocess.run(["git", "clone", repo_url, destination_folder], check=True, capture_output=True, text=True)
|
9 |
+
st.success(f"Repository cloned successfully: {repo_url} -> {destination_folder}")
|
10 |
+
st.text(result.stdout)
|
|
|
|
|
|
|
|
|
11 |
except subprocess.CalledProcessError as e:
|
12 |
+
st.error(f"Error cloning repository: {e}")
|
13 |
+
st.text(e.stderr)
|
14 |
+
|
15 |
+
st.title("GitHub Repository Cloner")
|
16 |
+
repo_url = st.text_input("Enter GitHub Repository URL", "https://github.com/NebulaServices/Nebula")
|
17 |
+
destination_folder = st.text_input("Enter Destination Folder (Optional)")
|
18 |
|
19 |
+
if st.button("Clone Repository"):
|
20 |
+
clone_github_repo(repo_url, destination_folder)
|
|
|
|