Select Git revision
build_deps.sh

David Beniamine authored
build_deps.sh 771 B
#!/bin/bash
## Runs action $2 for submodule $1
watch() {
inotifywait \
--event modify \
--event create \
--event delete \
--event move \
--monitor \
--quiet \
--recursive \
--format '%e %w%f' \
./src | while read line; do
echo "$line"
$@
done
}
run() {
mod=$1
shift
echo "Running '$@' on '$mod'"
cd $mod
$@
if $watch; then
watch $@ &
fi
cd ..
}
action=$1
watch=false
if [ "$action" == "watch" ]; then
action=build
watch=true
fi
echo "Submodule action '$action' triggered"
jq -r --arg action "$action" \
'.subscripts | to_entries[] | "\(.key) \(.value | .[$action])"' \
package.json | \
while read line; do
run $line
done