Skip to content

Instantly share code, notes, and snippets.

@MisterJimson
Created September 28, 2021 13:36
Show Gist options
  • Save MisterJimson/cfa5ba0dfa27137f6eb2755b356ca2b0 to your computer and use it in GitHub Desktop.
Save MisterJimson/cfa5ba0dfa27137f6eb2755b356ca2b0 to your computer and use it in GitHub Desktop.
launch_as() {
local cmd_name=$1
shift
(time $@ || echo $cmd_name >> fail.txt) 2>&1 > $cmd_name.txt
}
time npm ci
launch_as lint npm run lint &
time npm run build
launch_as build1 npm run build:build1 &
launch_as build2 npm run build:build2 &
launch_as build3 npm run build:build3 &
wait
cat lint.txt
cat build1.txt
cat build2.txt
cat build3.txt
if [ -f fail.txt ]; then
cat fail.txt
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment