gulp-nodemon icon indicating copy to clipboard operation
gulp-nodemon copied to clipboard

gulp-nodemon passing node cli arguments in quotes

Open dannyhuly opened this issue 7 years ago • 1 comments

Hi,

I'm having troubles passing cli arguments to through gulp-nodemon to node.

I would like to pass the filters argument and get the following when nodemon runs node tmp/ --filters test . But I'm getting the filters in quotes (node tmp/ "--filters test") for the following task

gulp.task('nodemon', function () {
    return nodemon({
        script: 'src/',
        watch: ['src/**/*.js'],
        ext: 'js',
        args: ['--filters test']
    })
})

gulp log:

[14:57:40] [nodemon] 1.11.0
[14:57:40] [nodemon] to restart at any time, enter `rs`
[14:57:40] [nodemon] watching: src/**/*.js
[14:57:40] [nodemon] starting `node src/ "--filters test"`

The node code can't handle the quotes and just passes over the arguments. Any ideas ?

Thanks.

dannyhuly avatar May 24 '17 12:05 dannyhuly

Hi, try to put one args by item in args array.

gulp.task('nodemon', function () {
    return nodemon({
        script: 'src/',
        watch: ['src/**/*.js'],
        ext: 'js',
        args: ['--filters', 'test']
    })
})

MaximeMaillet avatar Jan 17 '22 13:01 MaximeMaillet