From aa930f5033db0921bbe864d39c63e93da3ac59fb Mon Sep 17 00:00:00 2001 From: kengz Date: Sat, 15 Apr 2017 17:30:00 -0400 Subject: [PATCH] integrate conda and virtualenv into grunt cmd --- Gruntfile.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index d12f7bc..4c5b879 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -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 }