m19c / gulp-run

Pipe to shell commands in gulp
ISC License
151 stars 25 forks source link

Wait for powershell script to finish, callback not working? #45

Open evtk opened 7 years ago

evtk commented 7 years ago

Hello,

Great plugin, thanks!. Maybe I'm trying something impossible here, but let's give it a go. I'm using gulp-run to start up a powershell script that executes in a separate powershell window. I thought I could use the callback function to be able to have gulp-run to finish the task, after the powershell script has done it's job.. but can 't get it to work. I'm loading powershell with the 'Start-Process' command.

function deploy(done) {
 // some variable definitly left out (argumentlist)
  return run('Start-Process powershell.exe -ArgumentList ' + argumentList, { usePowerShell: true }).exec(function () {
    done();
  });
}
gulp.task('deploy', deploy);

This is the output, you can see it doesn't wait for completion:

[16:40:18] Starting 'deploy'...                                                                                                                                                                                    
[16:40:18] Finished 'deploy' after 543 ms                                                                                                                                                                          
$ Start-Process powershell.exe -ArgumentList etc....

Any thoughts on this? Thanks!

hrishikeshtt commented 6 years ago

Let me know do you have any updates on this ?

evtk commented 6 years ago

hi, sorry no updates to report.