Skip to content

Commit 92644cd

Browse files
committed
Merge pull request #29 from glennular/watchFix
Enhanced --watch
2 parents 8b89d64 + 8817017 commit 92644cd

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

gitcheck/gitcheck.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,7 @@ def gitcheck():
363363

364364
if argopts.get('watchInterval', 0) > 0:
365365
print(colortheme['reset'])
366+
print(strftime("%Y-%m-%d %H:%M:%S"))
366367

367368
showDebug("Processing repositories... please wait.")
368369
for r in repo:
@@ -529,10 +530,16 @@ def main():
529530
# sys.exit(2)
530531

531532
while True:
532-
gitcheck()
533+
try:
534+
gitcheck()
533535

534-
if argopts.get('email', False):
535-
sendReport(html.msg)
536+
if argopts.get('email', False):
537+
sendReport(html.msg)
538+
539+
except (KeyboardInterrupt, SystemExit):
540+
raise
541+
except Exception as e:
542+
print ("Unexpected error:", str(e))
536543

537544
if argopts.get('watchInterval', 0) > 0:
538545
time.sleep(argopts.get('watchInterval', 0))

0 commit comments

Comments
 (0)