From 9c709674182112fdb693c6bcb53b48db2823e0d3 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Wed, 5 Jul 2017 13:23:05 -0400 Subject: sigh --- src/org/stsci/Conda.groovy | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/org/stsci/Conda.groovy b/src/org/stsci/Conda.groovy index 7883499..d0736e0 100644 --- a/src/org/stsci/Conda.groovy +++ b/src/org/stsci/Conda.groovy @@ -54,16 +54,16 @@ class Conda implements Serializable { def env_dump = this.runshell("source ${prefix}/bin/activate ${conda_env} ; printenv", true) /* Split each environment keypair by first occurance of '=' */ - //env_dump.inputStream.eachLine { line -> - // if(line) { - // def (k, v) = line.split('=', 2).collect { it.trim() } - // /* Strip out envmodules if they exist, i.e. multiline variables*/ - // if (k.contains("_FUNC_") || !line.contains("=")) { - // return - // } - // records."$k" = v - // } - //} + env_dump.inputStream.eachLine { line -> + if(line) { + def pair = line.split('=', 2).collect { it.trim() } + /* Strip out envmodules if they exist, i.e. multiline variables*/ + if (pair[0].contains("_FUNC_") || !line.contains("=")) { + return + } + records."$k" = v + } + } /* runshell can now natively resolve this conda installation */ this.shell_environment = records -- cgit