nicosantangelo / sublime-gulp

Run Gulp tasks and use snippets from Sublime Text
https://sublime-gulp.nicosantangelo.com/
MIT License
155 stars 18 forks source link

Ability to pass flags (parameters) #18

Closed vitalybe closed 9 years ago

vitalybe commented 9 years ago

In our gulp the tasks can receive flags, e.g, I can run gulp build or gulp build --watch.

How do I pass flags with sublime-gulp?

nicosantangelo commented 9 years ago

Hello! I never used arguments in my tasks so I didn't add this feature (so it's not possible right now), but I think is a good idea.

I'll give it a try, but can you give me an example of some task that uses flags please? so I can test locally.

Thanks!

vitalybe commented 9 years ago

I ended up just using shell to run gulp, however, I still think it could be added as a nice feature. For example, we pass an environment flag to our gulp, like so: gulp build --env=windows

Then we check it inside like so:

var argv = require('minimist')(process.argv.slice(2));
var env = argv.env || null;
cperryk commented 9 years ago

+1. We use the --cwd flag with gulp because we have a single gulp file servicing many little projects.

nicosantangelo commented 9 years ago

Sorry for the big delay. I have a local branch for this feature but I haven't been able to get significant progress.

It might be taking me a lot more than expected but I'll keep you posted when I have something.

nicosantangelo commented 9 years ago

I finally got around doing this feature, sorry for the massive delay.

I'll close this for now but if you have any feedback let me know and I'll reopen it.