Skip to content

Commit

Permalink
integrate conda and virtualenv into grunt cmd
Browse files Browse the repository at this point in the history
  • Loading branch information
kengz committed Apr 15, 2017
1 parent eb84ca7 commit aa930f5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,11 @@ module.exports = function(grunt) {
eStr = resumeExperimentStr(eStr)
}

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;'

// override with custom command if has 'python'
var pyCmd = _.includes(eStr, 'python') ? eStr : `python3 main.py${bestCmd()}${debugCmd()}${quietCmd()} -t 5 -e ${eStr}`
const cmd = `${remoteCmd()} ${pyCmd} | tee ./data/terminal.log; ${notiCmd(eStr)}`
const pyCmd = _.includes(eStr, 'python') ? eStr : `python3 main.py${bestCmd()}${debugCmd()}${quietCmd()} -t 5 -e ${eStr}`
const cmd = `${remoteCmd()} ${envCmd} ${pyCmd} | tee ./data/terminal.log; ${notiCmd(eStr)}`
grunt.log.ok(`Composed command: ${cmd}`)
return cmd
}
Expand Down

0 comments on commit aa930f5

Please sign in to comment.