23 lines
472 B
Python
23 lines
472 B
Python
|
#!/usr/bin/env python3
|
||
|
|
||
|
|
||
|
from utils import handle_error, run_cmd
|
||
|
|
||
|
|
||
|
def checkout_branch(branch: str) -> None:
|
||
|
if run_cmd("git", "checkout", branch)[0] != 0:
|
||
|
if run_cmd("git", "checkout", "-b", branch)[0] != 0:
|
||
|
exit(1)
|
||
|
|
||
|
|
||
|
def add_files(*files: str) -> None:
|
||
|
run_cmd("git", "add", *files)
|
||
|
|
||
|
|
||
|
def commit(msg: str) -> None:
|
||
|
run_cmd("git", "commit", "-m", msg)
|
||
|
|
||
|
|
||
|
def push(remote: str, branch: str):
|
||
|
run_cmd("git", "push", "-u", remote, branch)
|