-
Notifications
You must be signed in to change notification settings - Fork 34
/
update.py
executable file
·31 lines (26 loc) · 1.03 KB
/
update.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
#!/usr/bin/env python3
import os
import subprocess
import sys
def install_check(directory):
if os.path.isdir(directory):
return True
else:
print('\nWARNING - %s does not exist!\nCreate a directory in your home directory called `ifigit` and git clone the repository in there' % directory)
return False
def main():
home = os.path.expanduser("~/")
os.chdir(home)
if install_check('ifigit/ifiscripts'):
os.chdir('ifigit/ifiscripts')
print("Updating IFIScripts - Changing directory to %s and running `git pull`" % os.getcwd())
subprocess.call(['git', 'checkout', 'master'])
subprocess.call(['git', 'pull'])
if install_check('../premisviewer'):
os.chdir('../premisviewer')
print('Updating PREMISviewer - Changing directory to %s and running `git pull`' % os.getcwd())
subprocess.call(['git', 'pull'])
print('\nNotice - 2017-01-13')
print('********** PREMISVIEWER is now part of update.py \n***************')
if __name__ == '__main__':
main()