From e4df78107c9e9bab3f9e15d50ef3c6554daf6762 Mon Sep 17 00:00:00 2001 From: Peter van 't Hof <p.j.van_t_hof@lumc.nl> Date: Thu, 12 Feb 2015 17:23:44 +0100 Subject: [PATCH] Fix error message --- .../lumc/sasc/biopet/core/config/Config.scala | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/core/config/Config.scala b/public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/core/config/Config.scala index faae1634a..aadd7cabb 100644 --- a/public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/core/config/Config.scala +++ b/public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/core/config/Config.scala @@ -43,14 +43,17 @@ class Config(var map: Map[String, Any]) extends Logging { * @param valueName Name of value */ def loadConfigEnv(valueName: String) { - val globalFiles = sys.env.get(valueName).getOrElse("").split(":") - if (globalFiles.isEmpty) logger.info(valueName + " value not found, no global config is loaded") - for (globalFile <- globalFiles) { - val file: File = new File(globalFile) - if (file.exists()) { - logger.info("Loading config file: " + file) - loadConfigFile(file) - } else logger.warn(valueName + " value found but file does not exist, no global config is loaded") + sys.env.get(valueName) match { + case Some(globalFiles) => { + for (globalFile <- globalFiles.split(":")) { + val file: File = new File(globalFile) + if (file.exists()) { + logger.info("Loading config file: " + file) + loadConfigFile(file) + } else logger.warn(valueName + " value found but file '" + file + "' does not exist, no global config is loaded") + } + } + case _ => logger.info(valueName + " value not found, no global config is loaded") } } -- GitLab