16 lines
570 B
Bash
Executable file
16 lines
570 B
Bash
Executable file
#!/usr/bin/env bash
|
|
# npm install in every cloned package that has package.json.
|
|
set -euo pipefail
|
|
DEST="${VERAE_SRC:-$HOME/verae-src}"
|
|
if [[ ! -d "$DEST" ]]; then
|
|
echo "missing $DEST — run scripts/clone.sh first" >&2
|
|
exit 1
|
|
fi
|
|
command -v node >/dev/null
|
|
command -v npm >/dev/null
|
|
find "$DEST" -maxdepth 2 -name package.json ! -path '*/node_modules/*' | while read -r pkg; do
|
|
dir="$(dirname "$pkg")"
|
|
echo "npm install $dir"
|
|
(cd "$dir" && npm install --no-audit --no-fund && npm rebuild --no-audit --no-fund >/dev/null)
|
|
done
|
|
echo "deps installed under $DEST"
|