From cb26bef3f3bc777bb307f997e0705f6c866c77d1 Mon Sep 17 00:00:00 2001 From: Piotr Faba Date: Thu, 18 Jun 2020 20:30:05 +0200 Subject: [PATCH] resolve #162 bug --- conf/bi.config | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/conf/bi.config b/conf/bi.config index f9dfb27..65059e3 100644 --- a/conf/bi.config +++ b/conf/bi.config @@ -3,16 +3,18 @@ params{ config_profile_contact = 'Alexander Peltzer (@apeltzer)' config_profile_url = 'https://www.boehringer-ingelheim.com/' } -params.globalConfig = determine_global_config() -includeConfig params.globalConfig +params.globalConfig = set_global_config() -def determine_global_config() { - if( System.getenv('NXF_GLOBAL_CONFIG') == null) - { - def errorMessage = "ERROR: Environment variable NXF_GLOBAL_CONFIG is missing. Set it to point to global.config file." - System.err.println(errorMessage) - throw new Exception(errorMessage) - } - return System.getenv('NXF_GLOBAL_CONFIG') + +def set_global_config() { + def config = System.getenv('NXF_GLOBAL_CONFIG') + if(config == null) + { + def errorMessage = "WARNING: For bi.config requires NXF_GLOBAL_CONFIG env var to be set. Point it to global.config file if you want to use this profile." + System.err.println(errorMessage) + }else{ + includeConfig config + } + return config }