0

To run my node server proxy and then my project in Gulp Browsersync, every time i need to run node server in one tab, open a tab in the same directory and run Gulp.

I'm not sure if the second tab is even needed, if there's a way to simply run Node Server in the background, and then issue "gulp" right there.

I was trying to find a way to script this project,to switch to the directory, run the node server, and then run gulp. Either with bash or applescript/bash.

I can write bash scripts myself for all parts except the need to run the 2 processes. That's the part that has me stumped.

1

In a shell script, you can ask for commands to be started in the background by appending &, for example, inferring plausible names from your question:

./node &
./gulp &

This could be a bit messy if one of the commands, not expecting to run in the background, writes to its output. In this case, I would recommend redirecting output to oblivion (&>/dev/null) or, if the output is relevant, scripting with GNU screen.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.