Compare commits

...

2 Commits

Author SHA1 Message Date
admin
69733e8d4c Initial commit 2025-12-08 18:01:04 +08:00
admin
0c5d90c12b Initial commit 2025-12-08 18:00:31 +08:00
2 changed files with 9 additions and 7 deletions

View File

@@ -44,7 +44,6 @@ __pycache__/
.vscode/
.idea/
*.log
.env
"""
with open(".gitignore", "w") as f:
f.write(content.strip())
@@ -55,9 +54,13 @@ __pycache__/
def main():
clone_url = None
# Initialize session and disable proxy
session = requests.Session()
session.trust_env = False
# 1. Create Repository via API
try:
response = requests.post(API_URL, auth=AUTH, json=REPO_DATA)
response = session.post(API_URL, auth=AUTH, json=REPO_DATA)
if response.status_code == 201:
print("Repository created successfully")
clone_url = response.json()['clone_url']
@@ -67,7 +70,7 @@ def main():
user = AUTH[0]
repo_name = REPO_DATA["name"]
get_url = f"https://git.aitosuv.com/api/v1/repos/{user}/{repo_name}"
resp_get = requests.get(get_url, auth=AUTH)
resp_get = session.get(get_url, auth=AUTH)
if resp_get.status_code == 200:
clone_url = resp_get.json()['clone_url']
else:
@@ -129,12 +132,12 @@ def main():
# We can try checking current branch name.
current_branch = run_command("git rev-parse --abbrev-ref HEAD")
if current_branch:
if run_command(f"git push -u origin {current_branch}") is None:
if run_command(f"git push -u origin {current_branch} -f") is None:
print("Push failed.")
else:
# Fallback if we couldn't get branch name
if run_command("git push -u origin master") is None:
run_command("git push -u origin main")
if run_command("git push -u origin master -f") is None:
run_command("git push -u origin main -f")
if __name__ == "__main__":
main()

View File

@@ -42,4 +42,3 @@ page {
flex-direction: column;
box-sizing: border-box;
}