Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hoe to take the argument from command-line? #24

Closed
siavash13 opened this issue Feb 28, 2015 · 1 comment
Closed

Hoe to take the argument from command-line? #24

siavash13 opened this issue Feb 28, 2015 · 1 comment

Comments

@siavash13
Copy link

I need to take an argument from the command line and use it in the gulp-file ?
This is my gulpfile.js
var run = require('gulp-run');

   gulp.task('default', function () {
     run('echo Hello user').exec() 
      .pipe(gulp.dest('output'))    
   })

How can I take an argument from Command line and pass it to this file , so that hello argument1 is pprinted instead of hello user?

@cbarrick
Copy link
Collaborator

I believe your question may be outside of the scope of this project. But something like this might work:

gulp.task('default', function () {
     run('echo Hello ' + process.argv[1]).exec() 
      .pipe(gulp.dest('output'))    
   })

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants