Skip to content

Commit

Permalink
build(agd): use timestamps again; hashes weren't necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelfig committed Apr 1, 2024
1 parent d668b20 commit 2c39d9c
Show file tree
Hide file tree
Showing 3 changed files with 174 additions and 207 deletions.
30 changes: 2 additions & 28 deletions .github/actions/restore-node/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ runs:
if test -e ~/endo; then
scripts/get-packed-versions.sh ~/endo | scripts/resolve-versions.sh
fi
STAMPS=node_modules/.cache/agoric
mkdir -p "$STAMPS"
yarn install
if ! cmp -s <(git cat-file blob HEAD:package.json) package.json; then
Expand All @@ -147,34 +149,6 @@ runs:
git checkout HEAD -- package.json
fi
function diffsha1() {
stamp=$1
shift
find ${1+"$@"} -exec sha1sum {} \; | sort +1 > "$stamp.new" || true
if test ! -s "$stamp.new"; then
echo "No new dependencies found for $stamp" 1>&2
return 0
fi
diff -u "$stamp" "$stamp.new" || return 1
return 0
}
# Find the current list of package.jsons.
files=( package.json )
while IFS= read -r line; do
files+=( "$line" )
done < <(yarn -s workspaces info |
sed -ne '/"location":/{ s/.*": "//; s!",.*!/package.json!; p; }')
STAMPS=node_modules/.cache/agoric
mkdir -p "$STAMPS"
sum="$STAMPS/yarn-installed.sum"
diffsha1 "$sum" "${files[@]}" || {
mv "$sum.new" "$sum"
}
rm -f "$sum.new"
if test -e ~/endo; then
# Stage the redirected `yarn install` consequences.
git add package.json yarn.lock
Expand Down
Loading

0 comments on commit 2c39d9c

Please sign in to comment.