Move exception catch and return 1 back to main gitcheckup.
This commit is contained in:
parent
88b3baafb8
commit
358ac9acbb
1 changed files with 6 additions and 6 deletions
|
@ -90,12 +90,8 @@ def checkup(directory, do_fetch=False):
|
|||
|
||||
def read_directories_file():
|
||||
directories_file = os.path.join(os.path.dirname(__file__), 'gitcheckup.txt')
|
||||
try:
|
||||
handle = open(directories_file, 'r')
|
||||
except FileNotFoundError:
|
||||
print(f'Please put your git repo locations in {directories_file}.')
|
||||
return 1
|
||||
|
||||
handle = open(directories_file, 'r')
|
||||
directories = handle.readlines()
|
||||
handle.close()
|
||||
|
||||
|
@ -105,7 +101,11 @@ def read_directories_file():
|
|||
return directories
|
||||
|
||||
def gitcheckup(do_fetch=False):
|
||||
try:
|
||||
directories = read_directories_file()
|
||||
except FileNotFoundError as exc:
|
||||
print(f'Please put your git repo locations in {exc.filename}.')
|
||||
return 1
|
||||
|
||||
for directory in directories:
|
||||
result = checkup(directory, do_fetch=do_fetch)
|
||||
|
|
Loading…
Reference in a new issue