Skip to content

Commit aa930f5

Browse files
committed
integrate conda and virtualenv into grunt cmd
1 parent eb84ca7 commit aa930f5

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Gruntfile.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,11 @@ module.exports = function(grunt) {
110110
eStr = resumeExperimentStr(eStr)
111111
}
112112

113+
const envCmd = 'if (conda env list | grep --quiet "openai_lab"); then echo "activating conda"; source activate openai_lab; elif [ -d ./.env ]; then echo "activating virtualenv"; source .env/bin/activate; else echo "using system python"; fi;'
114+
113115
// override with custom command if has 'python'
114-
var pyCmd = _.includes(eStr, 'python') ? eStr : `python3 main.py${bestCmd()}${debugCmd()}${quietCmd()} -t 5 -e ${eStr}`
115-
const cmd = `${remoteCmd()} ${pyCmd} | tee ./data/terminal.log; ${notiCmd(eStr)}`
116+
const pyCmd = _.includes(eStr, 'python') ? eStr : `python3 main.py${bestCmd()}${debugCmd()}${quietCmd()} -t 5 -e ${eStr}`
117+
const cmd = `${remoteCmd()} ${envCmd} ${pyCmd} | tee ./data/terminal.log; ${notiCmd(eStr)}`
116118
grunt.log.ok(`Composed command: ${cmd}`)
117119
return cmd
118120
}

0 commit comments

Comments
 (0)