Skip to content

Commit 477a258

Browse files
Skip writing lockfile hash in postinstall when installed as a dependency (#725)
1 parent 9bbaf15 commit 477a258

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

scripts/write-lockfile-hash.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,11 @@ SCRIPT_DIR="$( cd "$( dirname "$0" )" && pwd )"
1111
# Change to the parent directory of the script
1212
cd "$SCRIPT_DIR/.."
1313

14+
# Skip when running as an installed dependency,
15+
# the published package contains no package-lock.json.
16+
if [ ! -f package-lock.json ]; then
17+
exit 0
18+
fi
19+
1420
# Record the hash of the lockfile we just installed against
1521
sha256sum package-lock.json | awk '{print $1}' > "$LOCK_HASH_FILE"

0 commit comments

Comments
 (0)