mirror of
https://github.com/zhigang1992/npm.git
synced 2026-04-29 04:25:30 +08:00
Write builtin config with ./configure script
This commit is contained in:
20
configure
vendored
20
configure
vendored
@@ -1,10 +1,15 @@
|
||||
#!/bin/bash
|
||||
|
||||
# this is a wicked hack, but whatever.
|
||||
# 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
|
||||
@@ -23,17 +28,6 @@ while [ $# -gt 0 ]; do
|
||||
shift
|
||||
done
|
||||
|
||||
# Pull in submodules, since npm can't work without them.
|
||||
if [ -d .git ]; then
|
||||
git submodule update --init --recursive
|
||||
fi
|
||||
|
||||
for c in "${CONFIGS[@]}"; do
|
||||
echo '+node ./bin/npm.js config set "'"$c"'"'
|
||||
node ./bin/npm.js config set "$c"
|
||||
echo "$c" >> "$CONFFILE"
|
||||
done
|
||||
echo
|
||||
|
||||
echo +node ./bin/npm.js config ls
|
||||
echo
|
||||
node ./bin/npm.js config ls
|
||||
|
||||
Reference in New Issue
Block a user