Permalink
Browse files

Write builtin config with ./configure script

  • Loading branch information...
1 parent bbf5dfc commit ca71fc956dd589511d5258d3906a01edcd68555c @isaacs isaacs committed Oct 8, 2011
Showing with 7 additions and 13 deletions.
  1. +7 −13 configure
View
@@ -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

3 comments on commit ca71fc9

@kapouer
Contributor
kapouer commented on ca71fc9 Oct 9, 2011

Some feedback :

  • make clean should remove npmrc
  • if configure is called twice, npmrc has repeated config (could be zeroed before the for.. loop)
@isaacs
Member
isaacs commented on ca71fc9 Oct 9, 2011

make clean

Agreed. 26e4f5c

double configure

That's fine. The later settings will just override earlier ones, and npm will write standard ini output the first time it has to write the file.

@0sommer066-0

Does this override the loop?

Please sign in to comment.