3 # Update node install & modules from Chromium project.
7 cd /usr/local/src/chrome-ext
8 if [[ ! -d nodejs ]]; then
13 URL_GS_BASE='https://storage.googleapis.com/chromium-nodejs'
14 URL_HASH_NODE='https://chromium.googlesource.com/chromium/src/+/master/third_party/node/linux/node-linux-x64.tar.gz.sha1?format=TEXT'
15 URL_HASH_MOD='https://chromium.googlesource.com/chromium/src/+/master/third_party/node/node_modules.tar.gz.sha1?format=TEXT'
17 hash=$(curl -s "${URL_HASH_NODE}" | base64 -d)
19 cur_hash=$(cat "${dir}/hash" 2>/dev/null)
20 if [[ ${cur_hash} != "${hash}" ]]; then
21 rm -rf "${dir}" "${cur_hash}"
22 wget -m -nd "${URL_GS_BASE}/6.9.4/${hash}"
23 echo "Unpacking ${hash} into ${dir}"
25 echo "${hash}" >"${dir}/hash"
28 ln -sfT "${dir}" current
31 hash=$(curl -s "${URL_HASH_MOD}" | base64 -d)
33 cur_hash=$(cat "${dir}/hash" 2>/dev/null)
34 if [[ ${cur_hash} != "${hash}" ]]; then
35 rm -rf "${dir}" "${cur_hash}"
36 wget -m -nd "${URL_GS_BASE}/${hash}"
37 echo "Unpacking ${hash} into ${dir}"
39 echo "${hash}" >"${dir}/hash"
42 ln -sfT ../../node_modules/eslint/bin/eslint.js current/bin/eslint
49 # This is for nodejs directly.
50 URL_BASE='https://nodejs.org/dist/latest-v6.x'
52 URL_SUMS="${URL_BASE}/${SUMS}"
54 wget -m -nd "${URL_SUMS}"
56 read sum tar < <(grep 'linux-x64.tar.xz' "${SUMS}")
59 URL_TAR="${URL_BASE}/${tar}"
60 wget -m -nd "${URL_TAR}"
62 if [[ ! -d ${dir} ]] ; then
64 ln -sfT "${dir}" current