From 908b595f7f1064733474e9bba18bbc20cf0a6038 Mon Sep 17 00:00:00 2001 From: David Marcin Date: Tue, 22 Jun 2021 14:56:59 -0700 Subject: [PATCH] Fix NODE_BINARY_URL extraction --- CHANGELOG.md | 1 + lib/binaries.sh | 8 ++------ 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6a2b0750..adbb8224 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## main - Refactor $WEB_CONCURRENCY logic ([#931](https://github.com/heroku/heroku-buildpack-nodejs/pull/931)) - Fix broken tests, update node and yarn inventory, update shunit2 ([#934](https://github.com/heroku/heroku-buildpack-nodejs/pull/934)) +- Fix NODE_BINARY_URL extraction prefix stripping logic ([#928](https://github.com/heroku/heroku-buildpack-nodejs/pull/928)) ## v185 (2021-06-03) - Drop Heroku-16 from CI test matrix ([#920](https://github.com/heroku/heroku-buildpack-nodejs/pull/920)) diff --git a/lib/binaries.sh b/lib/binaries.sh index b347baed..35f108c1 100644 --- a/lib/binaries.sh +++ b/lib/binaries.sh @@ -89,10 +89,7 @@ install_yarn() { install_nodejs() { local version=${1:-14.x} local dir="${2:?}" - local code os cpu resolve_result - - os=$(get_os) - cpu=$(get_cpu) + local code resolve_result if [[ -n "$NODE_BINARY_URL" ]]; then url="$NODE_BINARY_URL" @@ -115,9 +112,8 @@ install_nodejs() { if [ "$code" != "200" ]; then echo "Unable to download node: $code" && false fi - tar xzf /tmp/node.tar.gz -C /tmp rm -rf "${dir:?}"/* - mv /tmp/node-v"$number"-"$os"-"$cpu"/* "$dir" + tar xzf /tmp/node.tar.gz --strip-components 1 -C "$dir" chmod +x "$dir"/bin/* }