File size: 1,070 Bytes
2eadae7
79ad461
1e6dd0c
2eadae7
 
79ad461
 
2eadae7
79ad461
 
 
2eadae7
79ad461
 
 
 
 
 
2eadae7
79ad461
 
1e6dd0c
 
 
 
 
d7d003f
28ba10c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import subprocess
import streamlit as st
import os

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)

# Streamlit app configuration
if 'STREAMLIT_PORT' not in os.environ:
    os.environ['STREAMLIT_PORT'] = '7860'

import os
os.system("streamlit run app.py --server.port 7860")