Skip to content

Commit

Permalink
馃 Merge PR #67460 Fix pnpm install script for large PRs by @jakebailey
Browse files Browse the repository at this point in the history
* Fix pnpm install script for large PRs

* pnpm ls
  • Loading branch information
jakebailey committed Nov 20, 2023
1 parent e245e11 commit 4a27acc
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .github/workflows/CI.yml
Expand Up @@ -44,6 +44,8 @@ jobs:
- run: ./scripts/pnpm-install.sh
name: pnpm install

- run: pnpm ls

# Run tests
- run: pnpm run test-all

Expand Down
3 changes: 3 additions & 0 deletions azure-pipelines.yml
Expand Up @@ -22,6 +22,9 @@ jobs:
- script: ./scripts/pnpm-install.sh
displayName: 'pnpm install'

- script: pnpm ls
displayName: 'pnpm ls'

- script: |
if [[ $BUILD_REASON == "Schedule" ]]; then git config --global user.email "types@microsoft.com" && git config --global user.name "TypeScript Bot" && pnpm run update-codeowners; fi
git checkout -- .
Expand Down
13 changes: 12 additions & 1 deletion scripts/pnpm-install.sh
Expand Up @@ -18,7 +18,18 @@ while true; do
OLD_FILTERS=("${FILTERS[@]}")
FILTERS=()

for i in $(pnpm ls --depth Infinity --parseable "${OLD_FILTERS[@]}" | grep -v node_modules | awk NF | sort -u); do
set +e
OUTPUT=$(pnpm ls --depth Infinity --parseable "${OLD_FILTERS[@]}")
CODE=$?
set -e

if [ $CODE -ne 0 ]; then
echo "pnpm ls failed while looking for missing deps; giving up and installing everything"
echo "$OUTPUT"
exec pnpm install
fi

for i in $(echo "$OUTPUT" | grep -v node_modules | awk NF | sort -u); do
i=${i#*$PWD/}

if [ -d "$i/node_modules" ]; then
Expand Down

0 comments on commit 4a27acc

Please sign in to comment.