-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgauto.py
More file actions
43 lines (31 loc) · 1008 Bytes
/
gauto.py
File metadata and controls
43 lines (31 loc) · 1008 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import click
import datetime
import os
import sys
import utils
class style():
RED = '\033[31m'
GREEN = '\033[32m'
RESET = '\033[0m'
@click.group()
def gauto():
'gauto is an automated git upload assistend.'
pass
# for generating a exe with pyinstaller
# pyinstaller gauto.py --onefile
# Upload command for git
@gauto.command()
@click.option('-m', '--message', default=utils.get_default_push_message(), show_default=True)
@click.option('-b', '--branch', default=utils.get_default_push_branch(), show_default=True)
def upload(message, branch):
os.system('git add .')
os.system(f'git commit -m "{str(message)}"')
os.system(f'git push -u origin {str(branch)}')
print(style.GREEN + 'Upload command finished. Please look for errors during the Process!' + style.RESET)
# Download command for git
@gauto.command()
@click.option('-b', '--branch', default=utils.get_default_pull_branch(), show_default=True)
def pull():
print()
if __name__ == '__main__':
gauto()