Compare commits
1 Commits
69733e8d4c
...
9e2cf035c1
| Author | SHA1 | Date | |
|---|---|---|---|
| 9e2cf035c1 |
Binary file not shown.
@@ -44,6 +44,7 @@ __pycache__/
|
||||
.vscode/
|
||||
.idea/
|
||||
*.log
|
||||
.env
|
||||
"""
|
||||
with open(".gitignore", "w") as f:
|
||||
f.write(content.strip())
|
||||
@@ -54,13 +55,9 @@ __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 = session.post(API_URL, auth=AUTH, json=REPO_DATA)
|
||||
response = requests.post(API_URL, auth=AUTH, json=REPO_DATA)
|
||||
if response.status_code == 201:
|
||||
print("Repository created successfully")
|
||||
clone_url = response.json()['clone_url']
|
||||
@@ -70,7 +67,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 = session.get(get_url, auth=AUTH)
|
||||
resp_get = requests.get(get_url, auth=AUTH)
|
||||
if resp_get.status_code == 200:
|
||||
clone_url = resp_get.json()['clone_url']
|
||||
else:
|
||||
@@ -132,12 +129,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} -f") is None:
|
||||
if run_command(f"git push -u origin {current_branch}") is None:
|
||||
print("Push failed.")
|
||||
else:
|
||||
# Fallback if we couldn't get branch name
|
||||
if run_command("git push -u origin master -f") is None:
|
||||
run_command("git push -u origin main -f")
|
||||
if run_command("git push -u origin master") is None:
|
||||
run_command("git push -u origin main")
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
||||
@@ -42,3 +42,4 @@ page {
|
||||
flex-direction: column;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user