diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2017-07-05 13:23:05 -0400 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2017-07-05 13:23:05 -0400 |
commit | 9c709674182112fdb693c6bcb53b48db2823e0d3 (patch) | |
tree | 86c92bf3d1e7bed04f7e13ecf1ccad63d790bcd0 | |
parent | 4ffe2e818c3f9b90422d42adfc186929f33122e3 (diff) | |
download | groovy-sandbox-test.tar.gz |
sightest
-rw-r--r-- | src/org/stsci/Conda.groovy | 20 |
1 files 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 |