paypro: script to generate trusted.js from node.js root certs.

This commit is contained in:
Christopher Jeffrey 2014-07-16 15:51:58 -07:00
parent 0d68e429fc
commit ee61422361
1 changed files with 21 additions and 0 deletions

View File

@ -0,0 +1,21 @@
#!/bin/bash
# Grab the node root certs. This will be our trusted certs file.
# wget https://raw.githubusercontent.com/joyent/node/master/tools/certdata.txt
wget https://raw.githubusercontent.com/joyent/node/master/src/node_root_certs.h \
|| curl -OJ https://raw.githubusercontent.com/joyent/node/master/src/node_root_certs.h
mv node_root_certs.h lib/browser/Trusted.js
pushd lib/browser &> /dev/null
sed -i '$s/,$//g' Trusted.js
echo "module.exports = ["$'\n'"$(cat Trusted.js)" > Trusted.js
echo "];" >> Trusted.js
sed -i 's/^"/+ "/g' Trusted.js
sed -i 's/^+ "-----B/"-----B/g' Trusted.js
popd &> /dev/null