]>
git.wh0rd.org - home.git/blob - .bin/update-vapier-nodejs
4065953e62c948666b961b7af1df17cc27ba697b
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'
16 # TODO: Find source of truth for this.
19 hash=$
(curl
-s "${URL_HASH_NODE}" | base64
-d)
21 cur_hash
=$
(cat "${dir}/hash" 2>/dev
/null ||
:)
22 if [[ ${cur_hash} != "${hash}" ]]; then
23 rm -rf "${dir}" "${cur_hash}"
24 wget
-m -nd "${URL_GS_BASE}/${VER}/${hash}"
25 echo "Unpacking ${hash} into ${dir}"
27 echo "${hash}" >"${dir}/hash"
30 ln -sfT "${dir}" current
33 hash=$
(curl
-s "${URL_HASH_MOD}" | base64
-d)
35 cur_hash
=$
(cat "${dir}/hash" 2>/dev
/null ||
:)
36 if [[ ${cur_hash} != "${hash}" ]]; then
37 rm -rf "${dir}" "${cur_hash}"
38 wget
-m -nd "${URL_GS_BASE}/${hash}"
39 echo "Unpacking ${hash} into ${dir}"
41 echo "${hash}" >"${dir}/hash"
44 ln -sfT ..
/..
/node_modules
/eslint
/bin
/eslint.js current
/bin
/eslint
51 # This is for nodejs directly.
52 URL_BASE
='https://nodejs.org/dist/latest-v6.x'
54 URL_SUMS
="${URL_BASE}/${SUMS}"
56 wget
-m -nd "${URL_SUMS}"
58 read sum tar < <(grep 'linux-x64.tar.xz' "${SUMS}")
61 URL_TAR
="${URL_BASE}/${tar}"
62 wget
-m -nd "${URL_TAR}"
64 if [[ ! -d ${dir} ]] ; then
66 ln -sfT "${dir}" current