1
0
mirror of https://github.com/deadc0de6/dotdrop.git synced 2026-02-08 16:39:17 +00:00

add ability to define the default profile using an environment variable

This commit is contained in:
deadc0de6
2018-09-01 16:15:25 +02:00
parent 5c61a24304
commit 1c3e8de039
2 changed files with 16 additions and 5 deletions

View File

@@ -24,7 +24,10 @@ from dotdrop.utils import *
CUR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
LOG = Logger()
HOSTNAME = socket.gethostname()
ENV_PROFILE = 'DOTDROP_PROFILE'
PROFILE = socket.gethostname()
if ENV_PROFILE in os.environ:
PROFILE = os.environ[ENV_PROFILE]
TILD = '~'
TRANS_SUFFIX = 'trans'
@@ -64,7 +67,7 @@ Options:
-v --version Show version.
-h --help Show this screen.
""".format(BANNER, HOSTNAME)
""".format(BANNER, PROFILE)
###########################################################
# entry point
@@ -322,6 +325,7 @@ def main():
"""entry point"""
ret = True
args = docopt(USAGE, version=VERSION)
try:
conf = Cfg(os.path.expanduser(args['--cfg']))
except ValueError as e: