mirror of
https://github.com/digital-asset/daml.git
synced 2024-09-20 01:07:18 +03:00
f7faf1e1f5
* HOTFIX: fix precommit (#18854) * fix precommit * avoid moving package.json --------- Co-authored-by: = <=> * fix yarn-lock-check precommit --------- Co-authored-by: = <=>
19 lines
520 B
Bash
Executable File
19 lines
520 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# Copyright (c) 2024 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
set -euo pipefail
|
|
|
|
TMP_DIR=$(mktemp -d)
|
|
trap 'rm -rf -- "$TMP_DIR"' EXIT
|
|
|
|
cp sdk/package.json sdk/yarn.lock $TMP_DIR
|
|
|
|
(cd $TMP_DIR; yarn install --silent > /dev/null)
|
|
|
|
if ! diff -u sdk/yarn.lock $TMP_DIR/yarn.lock; then
|
|
echo "FAIL: yarn.lock could not satisfy package.json" 1>&2
|
|
echo "FAIL: yarn.lock requires all of the above changes" 1>&2
|
|
exit 1
|
|
fi
|