Sha256: a3bef4b1af71e94cad8218a7c5818919ffedb4dfc747a60516728dcd38c10938

Contents?: true

Size: 1.03 KB

Versions: 2

Compression:

Stored size: 1.03 KB

Contents

#!/bin/sh

set -e
set -u

version="${1}"
libexec="$(cd "$(dirname "$0")"; pwd)"
top="${libexec}/.."
src="${2:-"${top}/src"}"

sha256sum='e016ab40079a540dc42a6ffc97b1e398d1d50dd9519f859a5539f0309cdea673'
check_sum() {
    filename="${1}"
    expected="${2}"
    if command -v shasum >/dev/null; then
        echo "${expected}  ${filename}" | shasum -c
    elif command -v gsha256sum >/dev/null; then
        echo "${expected}  ${filename}" | gsha256sum -c
    else
        echo "${expected}  ${filename}" | sha256sum -c
    fi
}

if [ -f "${src}/node-${version}.tar.gz" ]; then
    if check_sum "${src}/node-${version}.tar.gz" "${sha256sum}"; then
        exit 0
    fi
fi

platform=$(uname)

case "${platform}" in
    SunOS)
        CURLOPTS="${CURLOPTS:--k}"
        ;;
    *)
        CURLOPTS="${CURLOPTS:-}"
        ;;
esac

mkdir -p "${src}"

# shellcheck disable=SC2086
curl ${CURLOPTS} -L -o "${src}/node-${version}.tar.gz" "https://github.com/nodejs/node/archive/v${version}.tar.gz"

check_sum "${src}/node-${version}.tar.gz" "${sha256sum}" && exit 0

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
libv8-node-15.14.0.1 libexec/download-node
libv8-node-15.14.0.0 libexec/download-node