#!/bin/bash # Builds the current module and all of its **consumers** (in topological order). # Can inject any command to be run by lerna, but defaults to build. # # $ yarn install # $ cd packages/@aws-rfdk/deadline # $ ../../../scripts/builddown [learnaCommand] set -euo pipefail if ! [ -x "$(command -v yarn)" ]; then echo "yarn is not installed. Follow the guide to install yarn - https://yarnpkg.com/en/docs/install." exit 1 fi export NODE_OPTIONS="--max-old-space-size=4096 ${NODE_OPTIONS:-}" scriptdir=$(cd $(dirname $0) && pwd) export PATH=$(cd $scriptdir && npm bin):$PATH scope=$(${scriptdir}/current-scope) exec lerna run ${1:-build} --scope ${scope} --include-dependents