mirror of
https://github.com/nodejs/node.git
synced 2024-11-30 07:27:22 +01:00
d7d321b071
PR-URL: https://github.com/nodejs/node/pull/28853 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
34 lines
529 B
Bash
Executable File
34 lines
529 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
# set configurations that will be "sticky" on this system,
|
|
# surviving npm self-updates.
|
|
|
|
CONFIGS=()
|
|
i=0
|
|
|
|
# get the location of this file.
|
|
unset CDPATH
|
|
CONFFILE=$(cd $(dirname "$0"); pwd -P)/npmrc
|
|
|
|
while [ $# -gt 0 ]; do
|
|
conf="$1"
|
|
case $conf in
|
|
--help)
|
|
echo "./configure --param=value ..."
|
|
exit 0
|
|
;;
|
|
--*)
|
|
CONFIGS[$i]="${conf:2}"
|
|
;;
|
|
*)
|
|
CONFIGS[$i]="$conf"
|
|
;;
|
|
esac
|
|
let i++
|
|
shift
|
|
done
|
|
|
|
for c in "${CONFIGS[@]}"; do
|
|
echo "$c" >> "$CONFFILE"
|
|
done
|