From 0778b709d580cdf5d16196febcdcade76d885d33 Mon Sep 17 00:00:00 2001 From: PSoul Date: Tue, 8 May 2018 18:31:03 +0800 Subject: [PATCH] Update cobra.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 程序执行前先git pull后再执行 --- cobra.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/cobra.py b/cobra.py index 62e150a8..418868f7 100755 --- a/cobra.py +++ b/cobra.py @@ -14,9 +14,14 @@ """ import re import sys - -from cobra import main +import os if __name__ == '__main__': sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) - sys.exit(main()) + try: + os.system('git pull') + except: + pass + finally: + from cobra import main + sys.exit(main())