/
submit_work.py
executable file
·50 lines (38 loc) · 1023 Bytes
/
submit_work.py
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
44
45
46
47
48
49
50
#!/usr/bin/env python3
import os
import inspect
import time
cur_dir = os.path.dirname(inspect.getfile(inspect.currentframe()))
def git_clone(url, dest_dir):
'''
download third party packaged that cannot get from elpa
'''
save_path = os.path.join(cur_dir, "src", dest_dir)
if os.path.exists(save_path):
print("{0} already downloaded, just ignore".format(url))
return
print("Downloading {0} to {1} ...".format(url, save_path))
cmd = "git clone {0} {1}".format(url, save_path)
os.system(cmd)
def git_add():
'''
git add command
'''
print("git add -A .")
os.system("git add -A .")
def git_commit():
'''
git commit command
'''
print("git commit");
t = time.localtime()
os.system("git commit -m '%s'" % time.strftime("%Y年%m月%d日%H时%M分%S秒"))
def git_push():
'''
git push command
'''
os.system("git push origin master")
if __name__ == "__main__":
git_add()
git_commit()
git_push()