Skip to content
Snippets Groups Projects
Select Git revision
  • 6a3725ebdb219f1303b44be56e3a812dd350e285
  • main default protected
  • 24-everything-from-git
  • 45-create-new-poc-deployment-with-docker
  • 44-add-a-cli-tool
  • improve-deployment
  • 31-backend
  • bash-script-bug-fix
  • upgrades_submodules
  • 24-dependencies-build-nested-watch
  • 24-dependencies-build-using-workspaces
  • 24-dependencies-build
  • wip-all-local
  • 10-annotot
  • 3-annotation-plugin-showing-up
15 results

build_deps.sh

Blame
  • 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