1#!/usr/bin/env bash 2 3# set configurations that will be "sticky" on this system, 4# surviving npm self-updates. 5 6CONFIGS=() 7i=0 8 9# get the location of this file. 10unset CDPATH 11CONFFILE=$(cd $(dirname "$0"); pwd -P)/npmrc 12 13while [ $# -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 29done 30 31for c in "${CONFIGS[@]}"; do 32 echo "$c" >> "$CONFFILE" 33done 34