From cb351d7b76fd786287b47da71a110e764eddbb06 Mon Sep 17 00:00:00 2001 From: PSoul Date: Tue, 8 May 2018 20:30:54 +0800 Subject: [PATCH] Update cobra.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 程序执行前先git pull后再执行 fix #799 --- cobra.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/cobra.py b/cobra.py index f979ad88..418868f7 100755 --- a/cobra.py +++ b/cobra.py @@ -8,15 +8,20 @@ Implements cobra entry :author: Feei - :homepage: https://github.com/WhaleShark-Team/cobra + :homepage: https://github.com/FeeiCN/cobra :license: MIT, see LICENSE for more details. :copyright: Copyright (c) 2018 Feei. All rights reserved """ 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())