File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55"""
66
77from carousel .release_robot import get_current_version
8+ from dulwich .repo import NotGitRepository
9+ import os
10+
11+ BASEDIR = os .path .dirname (__file__ )
12+
13+
14+ def get_or_create_version (verfile = 'version.py' ):
15+ try :
16+ git_version = get_current_version ()
17+ except (ImportError , NotGitRepository ):
18+ git_version = None
19+ try :
20+ from carousel .version import VERSION
21+ except ImportError :
22+ VERSION = None
23+ if git_version is not None and VERSION != git_version :
24+ with open (os .path .join (BASEDIR , verfile ), 'w' ) as vf :
25+ vf .write ('VERSION = "%s"\n ' % git_version )
26+ else :
27+ git_version = VERSION
28+ return git_version
29+
830
931__author__ = u'Mark Mikofski'
1032__email__ = u'mark.mikofski@sunpowercorp.com'
1133__url__ = u'https://github.com/SunPower/Carousel'
12- __version__ = get_current_version ()
34+ __version__ = get_or_create_version ()
1335__release__ = u'Caramel Corn'
You can’t perform that action at this time.
0 commit comments