X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;f=.bin%2Fupdate-vapier-nodejs;h=158157fac9d3a5a5b36c932ef81d575839d4fe45;hb=a5d268ae5f05367aafbd17704e28a6dc495433a4;hp=41ddc2d9ae423514c85ab28c59f1a9aa9529c953;hpb=227530ea81de45b198815c7cc9ea80c5acc4df71;p=home.git diff --git a/.bin/update-vapier-nodejs b/.bin/update-vapier-nodejs index 41ddc2d..158157f 100755 --- a/.bin/update-vapier-nodejs +++ b/.bin/update-vapier-nodejs @@ -4,22 +4,27 @@ set -e -cd /usr/local/src/chrome-ext +cd /usr/local/src/extensions if [[ ! -d nodejs ]]; then mkdir nodejs fi 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' +URL_CHROMIUM_BASE='https://chromium.googlesource.com/chromium/src/+/master' +URL_DEPS="${URL_CHROMIUM_BASE}/DEPS?format=TEXT" +URL_HASH_NODE="${URL_CHROMIUM_BASE}/third_party/node/linux/node-linux-x64.tar.gz.sha1?format=TEXT" +URL_HASH_MOD="${URL_CHROMIUM_BASE}/third_party/node/node_modules.tar.gz.sha1?format=TEXT" + +hash=$(curl -s "${URL_DEPS}" | base64 -d) +VER=$(echo "${hash}" | grep -o 'chromium-nodejs/[0-9.]*' | sort -u | cut -d/ -f2) 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 +35,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}"