Skip to content

Instantly share code, notes, and snippets.

@ArturT
Last active September 27, 2018 20:36
Show Gist options
  • Save ArturT/f4bfb1884b3af51ae5de63d4dfabde9a to your computer and use it in GitHub Desktop.
Save ArturT/f4bfb1884b3af51ae5de63d4dfabde9a to your computer and use it in GitHub Desktop.
Install node dependencies in async way for multiple projects.
#!/bin/bash
# install dependencies for all react projects in background (async way)
cd app/frontend/app_a && yarn install &
cd app/frontend/app_b && yarn install &
cd app/frontend/app_c && yarn install &
# wait for all processes to finish before move on (sync step)
wait
# build the react apps (async way)
cd app/frontend/app_a && yarn build &
cd app/frontend/app_b && yarn build &
cd app/frontend/app_c && yarn build &
# wait for all processes to finish before complete the bash script (sync step)
wait
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment