Skip to content

Commit 12d6749

Browse files
authored
add option to git hooks to skip auto-install (#54248)
1 parent 02a6c06 commit 12d6749

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

src/workflows/husky/post-checkout

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
#!/bin/sh
22
[ -n "$CI" ] && exit 0
33

4+
# Ignore this check if user has DOCS_NO_AUTO_NPM set in their environment
5+
if [ -n "$DOCS_NO_AUTO_NPM" ]; then
6+
echo "Skipping auto-npm install because DOCS_NO_AUTO_NPM is set"
7+
exit 0
8+
fi
9+
410
# Same process in husky/post-merge
511
echo "Checking if packages need to be installed..."
612
if npm run cmp-files -- package-lock.json .installed.package-lock.json; then

src/workflows/husky/post-merge

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
#!/bin/sh
22
[ -n "$CI" ] && exit 0
33

4+
# Ignore this check if user has DOCS_NO_AUTO_NPM set in their environment
5+
if [ -n "$DOCS_NO_AUTO_NPM" ]; then
6+
echo "Skipping auto-npm install because DOCS_NO_AUTO_NPM is set"
7+
exit 0
8+
fi
9+
410
# Same process in husky/post-checkout
511
echo "Checking if packages need to be installed..."
612
if npm run cmp-files -- package-lock.json .installed.package-lock.json; then

0 commit comments

Comments
 (0)