Questions tagged [gulp-shell]

gulp-shell is a command line interface for gulp.

gulp-shell is a handy command line interface for gulp developed by Sun Zheng'an.

Basic example:

var gulp  = require('gulp');
var shell = require('gulp-shell');

gulp.task('basic-example', function () {
  return gulp.src('*.js', {read: false})
    .pipe(shell([
      'echo <%= f(file.path) %>',
      'ls -l <%= file.path %>'
    ], {
      templateData: {
        f: function (s) {
          return s.replace(/$/, '.bak')
        }
      }
    }));
});
15 questions
9
votes
2 answers

Gulp-Shell is not executing any commands

I'm trying to execute something using gulp-shell. My gulfile.js contains the following content: var gulp = require('gulp'), shell = require('gulp-shell'); gulp.task('test', function() { shell(['echo test']); }); Then I run it calling gulp…
NewGulpUserxx
  • 225
  • 4
  • 7
4
votes
1 answer

Running a command with arguments in gulp

I'm rewriting some bash code in gulp that produces several add-ons/extensions for different browsers inspired by the ublockorigin project on GitHub. For Firefox there's a line that is supposed to run a python script which takes a destination…
Ali Saberi
  • 864
  • 1
  • 10
  • 33
3
votes
0 answers

gulp-shell 'karma is not recognized an an internal or external command...'

I'm using gulp to concat, minify, and then test all of my JS. I want to include karma in there as well, but I can't seem to get gulp-shell 'karma start karma.conf.js' to work properly. Karma is added to PATH, as I'm able to run that command from the…
2
votes
1 answer

How to pass argument to gulp?

I am using gulp and gulp-shell packages for a php Laravel application, I just need to know if this is possible to pass argument from cmd to gulpfile.js ? this is my file: gulp.task('default', shell.task([ 'echo user', ])); Question: Is…
Siavosh
  • 2,314
  • 4
  • 26
  • 50
1
vote
0 answers

How to run shell script (.sh files) in Gulp 4?

Hello to everyone and Happy New Year! Since Gulp version 4 I can't run a shell script. I have simple shell script. if application id "com.adobe.estoolkit-4.0" is running then display dialog "Close The App!" buttons {"OK"} default button 1 end…
Vlad K.
  • 339
  • 1
  • 5
  • 15
1
vote
1 answer

Aurelia CLI and Gulp Shell

Is there a way to execute au build from the context of a specific folder? My folder structure is: - UI |-main | | | |-another | | | |-gulpfile.js My gulpfile.js looks something like: var…
Callum Linington
  • 14,213
  • 12
  • 75
  • 154
1
vote
1 answer

`npm run gulp` can not find module 'gulp-shell'?

I've deleted node modules folder and installed npm using npm install command. My gulpfile.js is also perfect because other people are working perfectly with this config, even I did with this config from my another machine. But when I try to run npm…
Jim Fahad
  • 635
  • 1
  • 8
  • 21
1
vote
1 answer

Gulp call sub modules

There is a parent folder (gulp module) which has some child folders (gulp modules too). I want to run the default gulp task of each child through the gulpfile of the parent. My approach was to iterate through the folders by using gulp-folders and…
Darkmiller
  • 50
  • 7
1
vote
0 answers

Gulp work in sequence

I ran into a problem where I have a task for a shell script and some other tasks I want to run in order. I've solved this issue for regular tasks by including run-sequence plugin. But the thing with that plugin is that every task should return a…
Ivan
  • 157
  • 11
1
vote
1 answer

Why "gulp test" runs the tests twice?

I have the following setup: package.json "scripts": { "test": "jest" } gulpfile.js gulp.task('test', shell.task('npm test')); When I run npm test, it runs tests once and stops. But, running gulp test results in running the tests twice. See the…
Misha Moroshko
  • 166,356
  • 226
  • 505
  • 746
1
vote
1 answer

Gulp shell delay

I'm trying to execute a shell command at the end of a series of gulp tasks. I noticed that the changes written to the project's files aren't being written before the shell command picks up some of the files and copies them elsewhere. I'm using…
johnwargo
  • 601
  • 2
  • 7
  • 22
0
votes
2 answers

Commander-plus with gulp

I'm writing a node cli tool with commander-plus. import program from 'commander-plus'; const prompts = ['a', 'b', 'c']; program.choose(prompts, (index) => { // never returns; }); And want to run it with a gulp task, mostly because its convenient…
ap-o
  • 170
  • 1
  • 8
0
votes
1 answer

How to use shell read in gulp?

I'm trying to set up a gulp file which asks for input from the user (for a variable name), but I can't get it working. I've got gulp-shell echo-ing fine, and it triggers the read command and asks for the input, but the variable isn't saved. Here's…
Craig Wheatley
  • 84
  • 1
  • 10
0
votes
1 answer

Why can't gulp-shell set environment variables?

I have the following simple gulpfile.js script: var gulp = require('gulp'); var shell = require('gulp-shell'); gulp.task('run-me', shell.task([ 'export sweet_param=5', 'echo $sweet_param' ])); The problem is that $sweet_param variable is not…
Konstantin Grushetsky
  • 1,012
  • 1
  • 15
  • 32
-1
votes
1 answer

how can we resolve Error in plugin "gulp-shell"?

After running gulp-server command, i am getting below error. 'rm' is not recognized as an internal or external command, operable program or batch file. [13:04:36] 'clear' errored after 60 ms [13:04:36] Error in plugin "gulp-shell" Message: Command…