Skip to content

Commit

Permalink
tolerating unset htmlDir, fixes maximilianh#124
Browse files Browse the repository at this point in the history
  • Loading branch information
maximilianh committed Jul 30, 2019
1 parent 5f0a67e commit 889f9a4
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/cbPyLib/cellbrowser/cellbrowser.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,9 +350,13 @@ def main_parseArgs():
return args, options

# ---- GLOBAL ----
defOutDir = expanduser(getConfig("htmlDir"))
defOutDir = getConfig("htmlDir")
if defOutDir is None:
defOutDir = expanduser(os.environ.get("CBOUT"))
defOutDir = os.environ.get("CBOUT")

if defOutDir is not None:
defOutDir = expanduser(defOutDir)

# ---- GLOBAL END ----

def cbBuild_parseArgs(showHelp=False):
Expand Down Expand Up @@ -3578,7 +3582,7 @@ def cbBuildCli():
logging.error("File %s does not exist." % fname)
cbBuild_parseArgs(showHelp=True)
if options.outDir is None:
logging.error("You have to specify at least the output directory or set the env. variable CBOUT.")
logging.error("You have to specify at least the output directory via -o or set the env. variable CBOUT or set htmlDir in ~/.cellbrowser.conf.")
cbBuild_parseArgs(showHelp=True)

outDir = options.outDir
Expand Down

0 comments on commit 889f9a4

Please sign in to comment.