Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100755 34 lines (28 sloc) 0.521 kb
e82e613 @isaacs Add a config script
isaacs authored
1 #!/bin/bash
2
ca71fc9 @isaacs Write builtin config with ./configure script
isaacs authored
3 # set configurations that will be "sticky" on this system,
4 # surviving npm self-updates.
e82e613 @isaacs Add a config script
isaacs authored
5
6 CONFIGS=()
7 i=0
8
ca71fc9 @isaacs Write builtin config with ./configure script
isaacs authored
9 # get the location of this file.
10 unset CDPATH
11 CONFFILE=$(cd $(dirname "$0"); pwd -P)/npmrc
12
e82e613 @isaacs Add a config script
isaacs authored
13 while [ $# -gt 0 ]; do
14 conf="$1"
15 case $conf in
16 --help)
9e21818 @isaacs misspelled configure
isaacs authored
17 echo "./configure --param=value ..."
e82e613 @isaacs Add a config script
isaacs authored
18 exit 0
19 ;;
20 --*)
21 CONFIGS[$i]="${conf:2}"
22 ;;
23 *)
24 CONFIGS[$i]="$conf"
25 ;;
26 esac
27 let i++
28 shift
29 done
30
31 for c in "${CONFIGS[@]}"; do
ca71fc9 @isaacs Write builtin config with ./configure script
isaacs authored
32 echo "$c" >> "$CONFFILE"
e82e613 @isaacs Add a config script
isaacs authored
33 done
Something went wrong with that request. Please try again.