I'm a Termux Python developer with a strong focus on building applications for Termux. My journey in programming has been driven by a passion for creating efficient, user-friendly solutions that leverage the power of mobile environments.
This Python script downloads all my repositories at once and updates them.
-
Create the Python script:
nano clone.py
-
Copy and paste the following code into
clone.py
:import os import requests # GitHub username username = 'dedsec1121fk' # Change this to the desired GitHub username # GitHub API URL to get the repositories url = f'https://api.github.com/users/{username}/repos' # Get the list of repositories response = requests.get(url) repos = response.json() # Clone or update each repository for repo in repos: repo_name = repo['name'] clone_url = repo['clone_url'] if os.path.isdir(repo_name): # If the repo already exists, pull the latest changes os.chdir(repo_name) os.system('git pull') os.chdir('..') print(f'Updated: {repo_name}') else: # Clone the repository if it doesn't exist os.system(f'git clone {clone_url}') print(f'Cloned: {repo_name}')
-
Save and exit the editor.
Run the script with the following command:
python clone.py