-
-
Notifications
You must be signed in to change notification settings - Fork 191
Expand file tree
/
Copy pathgit_pull.py
More file actions
48 lines (26 loc) · 945 Bytes
/
git_pull.py
File metadata and controls
48 lines (26 loc) · 945 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
44
45
46
47
48
#!/usr/bin/env python3
"""
Hydrus git pull convenience script.
"""
import os
import sys
import subprocess
from pathlib import Path
def main():
try:
repo_root = Path( __file__ ).parent
os.chdir( repo_root )
try:
subprocess.check_call( [ 'git', 'pull' ] )
except subprocess.CalledProcessError as e:
print( f'ERROR: Pull failed: {e}' )
sys.exit( 1 )
print( '--------' )
print( 'Done!' )
print()
finally:
if sys.platform == 'win32':
# most Win users are double-clicking the file and would appreciate a moment to see the "Done!" conclusion before the window disappears
input( 'Hit enter to close...' )
if __name__ == "__main__":
main()