diff options
author | Jan Pokorný <jpokorny@redhat.com> | 2014-01-08 23:38:45 +0100 |
---|---|---|
committer | Jan Pokorný <jpokorny@redhat.com> | 2014-01-08 23:38:45 +0100 |
commit | b2d5e39a4e1ae80da2971befd1b2039ebf3648cc (patch) | |
tree | 2decbe0a48d8b1b6df997f0fc790f1c0fb4077f2 | |
parent | b99c17b6e0709767122fee9699ace094c415cacc (diff) | |
download | dotfiles-b2d5e39a4e1ae80da2971befd1b2039ebf3648cc.tar.gz dotfiles-b2d5e39a4e1ae80da2971befd1b2039ebf3648cc.tar.xz dotfiles-b2d5e39a4e1ae80da2971befd1b2039ebf3648cc.zip |
Cert scripts: add preliminary support for npm bundle
IIRC, there is some catch, but...
Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
-rwxr-xr-x | scripts/certs/cert-import | 14 |
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 } |