From 09400a7e508b2d9007a6f92fa504c6b6528b2fd8 Mon Sep 17 00:00:00 2001 From: Eklavya Sharma Date: Tue, 24 May 2016 20:50:48 +0530 Subject: [PATCH] End compile-handlebars-templates gracefully. Catch KeyboardInterrupt from tools/compile-handlebars-templates, print a message and exit when running in forever mode. --- tools/compile-handlebars-templates | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/compile-handlebars-templates b/tools/compile-handlebars-templates index 64e7debf57..41a46ae2e3 100755 --- a/tools/compile-handlebars-templates +++ b/tools/compile-handlebars-templates @@ -47,5 +47,9 @@ def run_forever(): if __name__ == '__main__': if len(sys.argv) == 2 and sys.argv[1] == 'forever': - run_forever() - run() + try: + run_forever() + except KeyboardInterrupt: + print(sys.argv[0], "exited after receiving KeyboardInterrupt") + else: + run()