-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBashScript.py
executable file
·32 lines (29 loc) · 942 Bytes
/
BashScript.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
#!/usr/bin/python3
import sys
import sh
def main():
if len(sys.argv) == 2:
sh.cd(sys.argv[1])
print(sh.git("status"))
print("(Y/n): Are you sure you want to reset this directory?")
temp = str(input("Local changes will be deleted: "))
if temp=="y" or temp =="Y":
print(sh.git.reset("--hard", "HEAD"))
print(sh.git.clean("-f"))
print(sh.git.pull)
print(sh.git("status"))
else:
sys.exit(0)
else:
print(sh.git("status"))
print("(Y/n): Are you sure you want to reset this directory?")
temp = str(input("Local changes will be deleted: "))
if temp=="y" or temp =="Y":
print(sh.git.reset("--hard", "HEAD"))
print(sh.git.clean("-f"))
print(sh.git.pull)
print(sh.git("status"))
else:
sys.exit(0)
if __name__ == '__main__':
main()