From b2d5e39a4e1ae80da2971befd1b2039ebf3648cc Mon Sep 17 00:00:00 2001 From: Jan Pokorný Date: Wed, 8 Jan 2014 23:38:45 +0100 Subject: Cert scripts: add preliminary support for npm bundle MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit IIRC, there is some catch, but... Signed-off-by: Jan Pokorný --- scripts/certs/cert-import | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'scripts/certs') diff --git a/scripts/certs/cert-import b/scripts/certs/cert-import index 14cb7d4..6fd1770 100755 --- a/scripts/certs/cert-import +++ b/scripts/certs/cert-import @@ -38,14 +38,25 @@ cert_import_firefox() { done < <(cat) } +cert_import_npm() { + # XXX: use "npm config edit" instead until ca_file or something occurs: + # https://github.com/isaacs/npm/issues/4030 + [ "$1" != "1" ] && return + echo "Adding to npm bundle" >&2 + mkdir -p "$(dirname "${CA_BUNDLE_NPM}")" + cp ${CA_BUNDLE_NPM}{,.$(date '+%y%m%d%H%M%s')} + cat >>${CA_BUNDLE_NPM} +} + # CRL can only be appended to homebundle cert_import() { - local homebundle=0 firefox=0 mutt=0 crl=1 spec=0 + local homebundle=0 firefox=0 mutt=0 npm=0 crl=1 spec=0 while true; do case $1 in homebundle) homebundle=1;; firefox) firefox=1;; mutt) mutt=1;; + npm) npm=1;; all) homebundle=1; firefox=1; mutt=1;; --|*) break;; esac @@ -61,6 +72,7 @@ cert_import() { | tee >(cert_import_homebundle $homebundle) \ | tee >(cert_import_firefox $firefox) \ | tee >(cert_import_mutt $mutt) \ + | tee >(cert_import_npm $npm) \ | tee >(cert_import_homebundle $homebundle) ) |& colorize 1 } -- cgit