File size: 666 Bytes
ce1974e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import os
import git

def download_repo(repo_url: str, destination: str = "repo"):  
    """Clones a Git repository to a specified destination."""
    if os.path.exists(destination):
        print(f"Removing existing directory: {destination}")
        os.system(f"rm -rf {destination}")
    
    print(f"Cloning {repo_url} into {destination}...")
    git.Repo.clone_from(repo_url, destination)
    print("Clone completed!")

if __name__ == "__main__":
    REPO_URL = os.getenv("REPO_URL", "https://github.com/taellinglin/Carmen.git")  # Change to desired repo
    DEST_DIR = os.getenv("DEST_DIR", "repo")
    
    download_repo(REPO_URL, DEST_DIR)