From eed0ff40c9f141ba5705f15726a063e3f8485da5 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Thu, 21 Dec 2017 01:37:20 -0500 Subject: [PATCH] update-vapier-nodejs: fix working from empty --- .bin/update-vapier-nodejs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.bin/update-vapier-nodejs b/.bin/update-vapier-nodejs index 41ddc2d..4065953 100755 --- a/.bin/update-vapier-nodejs +++ b/.bin/update-vapier-nodejs @@ -13,13 +13,15 @@ cd nodejs URL_GS_BASE='https://storage.googleapis.com/chromium-nodejs' URL_HASH_NODE='https://chromium.googlesource.com/chromium/src/+/master/third_party/node/linux/node-linux-x64.tar.gz.sha1?format=TEXT' URL_HASH_MOD='https://chromium.googlesource.com/chromium/src/+/master/third_party/node/node_modules.tar.gz.sha1?format=TEXT' +# TODO: Find source of truth for this. +VER="8.9.1" hash=$(curl -s "${URL_HASH_NODE}" | base64 -d) dir='node-linux-x64' -cur_hash=$(cat "${dir}/hash" 2>/dev/null) +cur_hash=$(cat "${dir}/hash" 2>/dev/null || :) if [[ ${cur_hash} != "${hash}" ]]; then rm -rf "${dir}" "${cur_hash}" - wget -m -nd "${URL_GS_BASE}/6.9.4/${hash}" + wget -m -nd "${URL_GS_BASE}/${VER}/${hash}" echo "Unpacking ${hash} into ${dir}" tar xf "${hash}" echo "${hash}" >"${dir}/hash" @@ -30,7 +32,7 @@ ln -sfT "${dir}" current hash=$(curl -s "${URL_HASH_MOD}" | base64 -d) dir='node_modules' -cur_hash=$(cat "${dir}/hash" 2>/dev/null) +cur_hash=$(cat "${dir}/hash" 2>/dev/null || :) if [[ ${cur_hash} != "${hash}" ]]; then rm -rf "${dir}" "${cur_hash}" wget -m -nd "${URL_GS_BASE}/${hash}" -- 2.39.5