File size: 928 Bytes
2eadae7
79ad461
2eadae7
 
79ad461
 
2eadae7
79ad461
 
 
2eadae7
79ad461
 
 
 
 
 
2eadae7
79ad461
 
d7d003f
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import subprocess
import streamlit as st

def clone_github_repo(repo_url, destination_folder=None):
    if destination_folder is None:
        destination_folder = repo_url.split('/')[-1].replace('.git', '')
    try:
        result = subprocess.run(["git", "clone", repo_url, destination_folder], check=True, capture_output=True, text=True)
        st.success(f"Repository cloned successfully: {repo_url} -> {destination_folder}")
        st.text(result.stdout)
    except subprocess.CalledProcessError as e:
        st.error(f"Error cloning repository: {e}")
        st.text(e.stderr)

st.title("GitHub Repository Cloner")
repo_url = st.text_input("Enter GitHub Repository URL", "https://github.com/NebulaServices/Nebula")
destination_folder = st.text_input("Enter Destination Folder (Optional)")

if st.button("Clone Repository"):
    clone_github_repo(repo_url, destination_folder)
import os
os.system("streamlit run app.py")