Skip to content

Instantly share code, notes, and snippets.

@umegaya
Created June 5, 2018 06:04
Show Gist options
  • Save umegaya/3698a45f03f63b5831de304e2c081a92 to your computer and use it in GitHub Desktop.
Save umegaya/3698a45f03f63b5831de304e2c081a92 to your computer and use it in GitHub Desktop.
sample script to launch multiple parcel command to watch directory and finish when ctrl-c is pressed
# watch script for parcel
if [ -z "$1" ]; then
# watch all
(
trap "kill 0" EXIT
for dir in `ls ./functions/` ; do
if [ -d "./functions/$dir" ]; then
parcel ./functions/$dir/index.ts -d dist/$dir &
fi
done
wait
)
else
parcel ./functions/$1/index.ts -d dist/$1 --log-level 3
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment