summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xscripts/certs/cert-import14
1 files changed, 13 insertions, 1 deletions
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
}