Now you have
spawn available to call. Just send it the right stuff. I have a
deploy.sh script that I want to run. The command I’ll actually run is
sh, and I’ll pass the name of the script to it in the 2nd parameter. I can also specify other options in the 3rd parameter. For instance, I want this to execute in a certain directory and with certain commands available to it via the
PATH variable. And so:
1 2 3 4 5
This will execute the shell script. There are other callback events that you may/not want to set to grab the data that comes back from the process, such as ‘data’, ‘end’, or ‘exit’.