Fall back to wget in ensure_node when curl is unavailable
The self-hosted qa runner has neither curl nor wget guaranteed; ensure_node previously assumed curl, breaking smoke-qa on that host.
This commit is contained in:
@@ -68,7 +68,14 @@ ensure_node() {
|
||||
if [[ ! -x "$install_dir/bin/node" ]]; then
|
||||
log "node not found on PATH; installing Node.js v$node_version"
|
||||
local tarball="node-v${node_version}-linux-x64"
|
||||
curl -fsSL "https://nodejs.org/dist/v${node_version}/${tarball}.tar.xz" -o "/tmp/${tarball}.tar.xz"
|
||||
local url="https://nodejs.org/dist/v${node_version}/${tarball}.tar.xz"
|
||||
if command -v curl > /dev/null 2>&1; then
|
||||
curl -fsSL "$url" -o "/tmp/${tarball}.tar.xz"
|
||||
elif command -v wget > /dev/null 2>&1; then
|
||||
wget -q "$url" -O "/tmp/${tarball}.tar.xz"
|
||||
else
|
||||
fail "neither curl nor wget found on PATH; cannot download Node.js"
|
||||
fi
|
||||
mkdir -p "$install_dir"
|
||||
tar -xJf "/tmp/${tarball}.tar.xz" -C "$install_dir" --strip-components=1
|
||||
rm -f "/tmp/${tarball}.tar.xz"
|
||||
|
||||
Reference in New Issue
Block a user