Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 27 additions & 10 deletions tools/dep_updaters/update-acorn-walk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,38 @@ compare_dependency_version "acorn-walk" "$NEW_VERSION" "$CURRENT_VERSION"

cd "$( dirname "$0" )/../.." || exit

rm -rf deps/acorn/acorn-walk
echo "Making temporary workspace..."

(
rm -rf acorn-walk-tmp
mkdir acorn-walk-tmp
cd acorn-walk-tmp || exit
WORKSPACE=$(mktemp -d 2> /dev/null || mktemp -d -t 'tmp')

"$NODE" "$NPM" init --yes
cleanup () {
EXIT_CODE=$?
[ -d "$WORKSPACE" ] && rm -rf "$WORKSPACE"
exit $EXIT_CODE
}

"$NODE" "$NPM" install --global-style --no-bin-links --ignore-scripts "acorn-walk@$NEW_VERSION"
)
trap cleanup INT TERM EXIT

mv acorn-walk-tmp/node_modules/acorn-walk deps/acorn
cd "$WORKSPACE"

rm -rf acorn-walk-tmp/
echo "Fetching ada source archive..."

DIST_URL=$(curl -sL "https://registry.npmjs.org/acorn-walk/$NEW_VERSION" | jq -r .dist.tarball)

ACORN_WALK_TGZ="acorn-walk.tgz"

curl -sL -o "$ACORN_WALK_TGZ" "$DIST_URL"

log_and_verify_sha256sum "acorn-walk" "$ACORN_WALK_TGZ"

rm -rf "$DEPS_DIR/acorn/acorn-walk"
mkdir -p "$DEPS_DIR/acorn/acorn-walk"

tar -xf "$ACORN_WALK_TGZ"

mv "$WORKSPACE/package" "$DEPS_DIR/acorn/acorn-walk"

rm "$ACORN_WALK_TGZ"

echo "All done!"
echo ""
Expand Down