Files
spacebarchat/scripts/setup/generate.py
BigweldIndustries 7e2421e5c2 Close files after use for setup script
This is a good practice in python, and while negligible, is better to do.
2022-03-20 17:00:41 +00:00

25 lines
664 B
Python

# Script to:
# - Get all repo git urls from the fosscord orga and format them to make the process of updating the setup script less tiresome
# - Create a workspace file for VScode
import requests
workspace = {
"folders":[]
}
repos = ""
response = requests.get("https://api.github.com/users/fosscord/repos").json()
for repo in response:
name = repo['name'].replace('fosscord-','')
workspace["folders"].append({"path":f"{name}"})
repos += f"git clone {repo['git_url']} {name}\n"
with open("clone_all_repos.sh","w") as f:
f.write(repos)
f.close()
with open("fosscord.code-workspace", "w") as f:
f.write(str(workspace).replace("'",'"'))
f.close()