Monorepo: update post-merge hook - make instalaltion conditional. (#50254)
If the merged changes are unrelated to dependency management and Composer/PNPM manifests, do not refresh dependencies.
This commit is contained in:
parent
83b12d59ee
commit
1440d26bf0
|
@ -1,4 +1,10 @@
|
||||||
#!/bin/sh
|
#!/usr/bin/env bash
|
||||||
. "$(dirname "$0")/_/husky.sh"
|
. "$(dirname "$0")/_/husky.sh"
|
||||||
|
|
||||||
pnpm install --frozen-lockfile
|
changedManifests=$( ( git diff --name-only HEAD ORIG_HEAD | grep -E '(package.json|pnpm-lock.yaml|pnpm-workspace.yaml|composer.json|composer.lock)$' ) || echo '' )
|
||||||
|
if [ -n "$changedManifests" ]; then
|
||||||
|
printf "It was a change in the following file(s) - refreshing dependencies:\n"
|
||||||
|
printf " %s\n" $changedManifests
|
||||||
|
|
||||||
|
pnpm install --frozen-lockfile
|
||||||
|
fi
|
||||||
|
|
Loading…
Reference in New Issue