Questions tagged [grunt-exec]

Grunt plugin for executing shell commands.

Grunt plugin for executing shell commands.

16 questions
6
votes
1 answer

How to get feed output of a grunt task to another grunt task?

I'm not sure if grunt can do this. I have two grunt tasks that I want to run. The first task is to create a mock post and the second is to run penthouse task to inline css. Any hacky way is welcome. This is the exec task that I have to run to…
toy
  • 11,711
  • 24
  • 93
  • 176
3
votes
2 answers

How do I register multiple grunt-exec tasks?

I want to define a tree of shell commands in my Gruntfile.js, using grunt-exec to write shell commands. I can do this for a single command, but I can't figure out the syntax for writing multiple sets of commands, and being able to call them…
mcandre
  • 22,868
  • 20
  • 88
  • 147
2
votes
1 answer

Grunt plugin grunt-exec v2.0.0 doesn't execute a simple command while v1.0.1 does

I was using grunt-exec v1.0.1 with this configuration in Gruntfile.js: grunt.initConfig({ exec: { tsc: { cmd: "tsc" } }, ... } ... grunt.loadNpmTasks('grunt-exec'); grunt.registerTask('debug', [ ... …
francadaval
  • 2,451
  • 3
  • 26
  • 36
1
vote
0 answers

Watching and compile TypeScript with Grunt

gruntfile.js module.exports = function (grunt) { grunt.initConfig( { pkg: grunt.file.readJSON('package.json'), watch : { files : ['**/*.ts'], tasks : ['exec:run_tsc'] }, exec: { …
1
vote
0 answers

grunt-exec doesn't recognize a custom function defined in bash

Grunt version: CLI - v1.2.0 local - v1.0.1 I'm using grunt-exec to start a local DynamoDB server. I'm doing this by creating a custom function in .bashrc then calling it inside grunt-exec. I also tried explicitly creating an alias, which didn't…
spicypumpkin
  • 1,209
  • 2
  • 10
  • 21
1
vote
2 answers

Set environment variables grunt or grunt-exec

I'm trying to use grunt-exec to run a javascript test runner with a deployed link variable passed in. I am trying to do so by setting an environment variable grunt.option('link') using exec:setLink. In my test_runner.js I grab the variable with…
Tyler
  • 1,705
  • 2
  • 18
  • 26
1
vote
1 answer

For loop in grunt to run the same script but pass in different args

so I have this javascript file that I can currently run with the cmd node runfile.js accountName. I am trying to make a grunt task that will loop through an array of accountNames to pass into this cmd using grunt-exec. I am pretty new to grunt and…
1
vote
1 answer

grunt exec freezes, expecting 0 status code from django collectstatic

I'm tring to make grunt exec perform django collectstatic command after building the statics. So, in my Gruntfile.js I have: grunt.initConfig({ ... exec: { collectstatic: { cwd: '../../', cmd: 'python…
Boris Burkov
  • 13,420
  • 17
  • 74
  • 109
1
vote
1 answer

Grunt exec running a node command in background

I'm trying to run grunt with a js script. The script start up a server that should be listening all the time in background. To it I'm using grunt and grunt-exec, and my exec.js is like that start: { cmd: function () { var start =…
Scipion
  • 1,350
  • 1
  • 10
  • 16
1
vote
1 answer

How can I get grunt to run a remote command that prompts for a sudo password?

I'm using grunt, and I need it to execute a script on a remote machine that requires sudo access, and therefore prompts for a password. I want it to prompt for the password, because I don't want to have to commit the password to source control. From…
tommarshall
  • 2,038
  • 5
  • 23
  • 36
0
votes
1 answer

Specify a python version with fallback in grunt exec

I have a Gruntfile with grunt-exec specified as follows: exec: { python_command: { cwd: "../../", command: 'python3.7 -c "MY_PYTHON_CODE"' I want to use python3.7 if it exists on the system, but otherwise fall back to using…
user2667066
  • 1,867
  • 2
  • 19
  • 30
0
votes
1 answer

FTP using bash script with Grunt Task Manager

I am trying to FTP files from local distribution build to production using Grunt. I have tested by bash file and it works. I just can't get it to run using grunt. In my grunt file: /*global module:false*/ module.exports = function(grunt) { …
MoreScratch
  • 2,933
  • 6
  • 34
  • 65
0
votes
1 answer

Execute next grunt.task.run() if previous one failed

I am currently running a set of tasks inside a for loop in grunt. Ex: data.accounts.forEach(function(payload){ grunt.task.run('exec:task1:'+payload.account+':'+payload.password); …
0
votes
1 answer

Passing node version to grunt-exec

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')){ …
iwatakeshi
  • 697
  • 3
  • 17
  • 31
0
votes
1 answer

Sass not recognized by Grunt in Cygwin

I'm trying to create a very simple build system with Grunt in windows using Cygwin to handle compiling,concatenation and minification of my scss/css and coffee/js files. I'm having problem with Grunt not recognizing Sass as a command. I should note…
Luken00
  • 21
  • 5
1
2