3 # Update node install & modules from Chromium project.
7 cd /usr/local/src/extensions
8 if [[ ! -d nodejs ]]; then
13 URL_GS_BASE='https://storage.googleapis.com/chromium-nodejs'
14 URL_CHROMIUM_BASE='https://chromium.googlesource.com/chromium/src/+/master'
15 URL_DEPS="${URL_CHROMIUM_BASE}/DEPS?format=TEXT"
16 URL_HASH_NODE="${URL_CHROMIUM_BASE}/third_party/node/linux/node-linux-x64.tar.gz.sha1?format=TEXT"
17 URL_HASH_MOD="${URL_CHROMIUM_BASE}/third_party/node/node_modules.tar.gz.sha1?format=TEXT"
19 hash=$(curl -s "${URL_DEPS}" | base64 -d)
20 VER=$(echo "${hash}" | grep -o 'chromium-nodejs/[0-9.]*' | sort -u | cut -d/ -f2)
22 hash=$(curl -s "${URL_HASH_NODE}" | base64 -d)
24 cur_hash=$(cat "${dir}/hash" 2>/dev/null || :)
25 if [[ ${cur_hash} != "${hash}" ]]; then
26 rm -rf "${dir}" "${cur_hash}"
27 wget -m -nd "${URL_GS_BASE}/${VER}/${hash}"
28 echo "Unpacking ${hash} into ${dir}"
30 echo "${hash}" >"${dir}/hash"
33 ln -sfT "${dir}" current
36 hash=$(curl -s "${URL_HASH_MOD}" | base64 -d)
38 cur_hash=$(cat "${dir}/hash" 2>/dev/null || :)
39 if [[ ${cur_hash} != "${hash}" ]]; then
40 rm -rf "${dir}" "${cur_hash}"
41 wget -m -nd "${URL_GS_BASE}/${hash}"
42 echo "Unpacking ${hash} into ${dir}"
44 echo "${hash}" >"${dir}/hash"
47 ln -sfT ../../node_modules/eslint/bin/eslint.js current/bin/eslint
54 # This is for nodejs directly.
55 URL_BASE='https://nodejs.org/dist/latest-v6.x'
57 URL_SUMS="${URL_BASE}/${SUMS}"
59 wget -m -nd "${URL_SUMS}"
61 read sum tar < <(grep 'linux-x64.tar.xz' "${SUMS}")
64 URL_TAR="${URL_BASE}/${tar}"
65 wget -m -nd "${URL_TAR}"
67 if [[ ! -d ${dir} ]] ; then
69 ln -sfT "${dir}" current