Would anyone know how to pass the current node version into grunt-exec? Currently I have grunt exec setup like the following:
grunt.initConfig({
exec:{
mocha: {
cmd:function(version){
if(semver.gt(version, '0.10')){
return 'mocha test/index.js';
} else return 'mocha --harmony test/harmony/index.js';
}
}
}
});
In grunt.registerTask()
, I have tried using a bash command like so
grunt.registerTask('default', [
'exec:mocha:$(node version)'
]);
but of course it doesn't work that way.
I have looked plugins such as grunt-node-version
but the lack of an actual example doesn't help much.
Any suggestions?