4 ms·
Also, needlessly sequential tasks. For example, to concurrently install NPM packages in many projects: npmi() { local pids="" for app in $apps;
by efortis 4y ago
Also, needlessly sequential tasks. For example, to concurrently install NPM packages in many projects:
npmi() {
local pids=""
for app in $apps; do
echo "Installing NPMs on $app..."
cd $REPO/$app
npm install &
pids="$pids $!"
done
wait $pids
}
https://github.com/uxtely/ops-utils/blob/main/npm.sh https://github.com/uxtely/ops-utils/blob/main/npm.sh
- chriswarbo 4y agoGNU parallel is also really good for replacing loops with concurrency. Your example might look something like: for app in $apps; do echo "Installing NPMs on $app..." 1>&2 echo "$app" done | parallel --will-cite "cd $REPO/{} && npm install"
- thisNeeds2BeSad 4y agothanks..