Skip to content

Commit

Permalink
fixed npm install script
Browse files Browse the repository at this point in the history
  • Loading branch information
alansemenov authored and pull-merger[bot] committed Nov 1, 2023
1 parent 89a57c3 commit 0e1492d
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion npm-install-all.sh
Original file line number Diff line number Diff line change
@@ -1 +1,12 @@
find . -name package.json -not -path "*/node_modules/*" -exec bash -c "npm --prefix \$(dirname {}) install --omit=dev --no-audit" \;
#!/bin/bash

# Find all directories containing package.json files, up to 2 levels deep, excluding node_modules
directories=$(find . -maxdepth 3 -type d -name "node_modules" -prune -o -type f -name "package.json" -exec dirname {} \;)

# Loop through each directory
for dir in $directories; do
echo "Installing dependencies in $dir"
cd "$dir" || exit 1
npm install
cd - || exit 1
done

0 comments on commit 0e1492d

Please sign in to comment.