Closed cbarrick closed 10 years ago
Works like a charm. I used
gulp.task('npm', function (callback) {
run('npm install').exec(undefined, callback);
});
gulp.task('bower', function (callback) {
run('bower install').exec(undefined, callback);
});
which works really great on Windows 8.1 node v0.10.29 (automatically calls npm.cmd
which child_process.spawn doesn't)
Thanks guys.
Thanks for the help
Doesn't work for commands like "mkdir -p somedir", which will actually create two directories, instead of checking if "somedir" exists.
There is no -p
option on Windows's mkdir
.
If you're trying to use a POSIX compliant mkdir
, try giving it the full path to the binary, or maybe run gulp from a Cygwin shell (in which case there's no need to use the windows option in gulp-run).
But... Why is it trying to run Windows native commands?
Isn't the whole point of this plugin to pipe commands to the shell? I'm using bash and running "mkdir -p somedir" works fine in the CLI.
If that's not the point of this plugin, would you then know what other plugin does support this?
By default, gulp-run uses cmd.exe on Windows instead of bash. That way it can work for all Windows users without depending on bash. You can use the full path to the mkdir binary you want to use, or change your PATH environment variable so the posix mkdir takes priority over the Windows mkdir. I think PowerShell's mkdir supports -p
, so you can try the powershell option too.
or try bash -c mkdir -p somedir
as the command
That last command doesn't work.
I'll just resort to piping the stream to a gulp.dest(). It's not pretty but it does the job as it automatically takes care of creating a folder if it's not present.
Experimental Windows support has landed in master. The only difference is that gulp-run on Windows calls
cmd.exe /c <command>
instead ofsh -c <command>
.Can a Windows user run the tests and report back here? The help would be very much appreciated!