auto-semver/semver/get_version.py

21 lines
392 B
Python
Raw Normal View History

2018-05-23 21:41:35 +02:00
try:
from configparser import ConfigParser
except ImportError:
# Python < 3
from ConfigParser import ConfigParser
def get_version():
config = ConfigParser()
2018-05-23 21:09:14 +02:00
config.read('./.bumpversion.cfg')
version = config.get('bumpversion', 'current_version')
return version
2018-05-23 21:09:14 +02:00
def main():
print(get_version())
if __name__ == '__main__':
2018-05-23 21:09:14 +02:00
try: main()
except: raise