|
|
|
import subprocess |
|
import os |
|
|
|
def run_git_command(command): |
|
"""git ๋ช
๋ น์ ์คํํ๊ณ ๊ฒฐ๊ณผ๋ฅผ ์ถ๋ ฅ""" |
|
try: |
|
result = subprocess.run(command, shell=True, capture_output=True, text=True, cwd=".") |
|
print(f"Command: {command}") |
|
print(f"Exit code: {result.returncode}") |
|
if result.stdout: |
|
print(f"Output:\n{result.stdout}") |
|
if result.stderr: |
|
print(f"Error:\n{result.stderr}") |
|
print("-" * 50) |
|
return result.returncode == 0 |
|
except Exception as e: |
|
print(f"Error running command: {e}") |
|
return False |
|
|
|
if __name__ == "__main__": |
|
|
|
commands = [ |
|
"git add .", |
|
"git commit -m 'Initial commit: LaonA2 VL 3B model'", |
|
"git remote -v", |
|
"git push -u origin main --force" |
|
] |
|
|
|
for cmd in commands: |
|
print(f"\n๐ Executing: {cmd}") |
|
success = run_git_command(cmd) |
|
if not success and "push" in cmd: |
|
print("Push failed, continuing...") |
|
elif not success and "commit" in cmd: |
|
print("Commit may have failed due to no changes, continuing...") |