1 | #!/bin/bash
|
2 |
|
3 | # set configurations that will be "sticky" on this system,
|
4 | # surviving npm self-updates.
|
5 |
|
6 | CONFIGS=()
|
7 | i=0
|
8 |
|
9 | # get the location of this file.
|
10 | unset CDPATH
|
11 | CONFFILE=$(cd $(dirname "$0"); pwd -P)/npmrc
|
12 |
|
13 | while [ $# -gt 0 ]; do
|
14 | conf="$1"
|
15 | case $conf in
|
16 | --help)
|
17 | echo "./configure --param=value ..."
|
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
|
32 | echo "$c" >> "$CONFFILE"
|
33 | done
|