Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorisaacs <i@izs.me>2011-04-07 00:42:49 +0400
committerisaacs <i@izs.me>2011-04-07 01:08:38 +0400
commite82e6136cc2a73ee40fa8d49e917ce264692e860 (patch)
treef24a01ba8fa4fef872bd2103ab37a4553c31f1ae /config
parent6cd7a13eae02116a7adcbb1969643523dd5704a8 (diff)
Add a config script
Fairly common request. Just writes to the .npmrc
Diffstat (limited to 'config')
-rwxr-xr-xconfig34
1 files changed, 34 insertions, 0 deletions
diff --git a/config b/config
new file mode 100755
index 000000000..27fd1b0eb
--- /dev/null
+++ b/config
@@ -0,0 +1,34 @@
+#!/bin/bash
+
+# this is a wicked hack, but whatever.
+
+CONFIGS=()
+i=0
+
+while [ $# -gt 0 ]; do
+ conf="$1"
+ case $conf in
+ --help)
+ echo "./config --param=value ..."
+ exit 0
+ ;;
+ --*)
+ CONFIGS[$i]="${conf:2}"
+ ;;
+ *)
+ CONFIGS[$i]="$conf"
+ ;;
+ esac
+ let i++
+ shift
+done
+
+for c in "${CONFIGS[@]}"; do
+ echo '+node ./bin/npm.js config set "'"$c"'"'
+ node ./bin/npm.js config set "$c"
+done
+echo
+
+echo +node ./bin/npm.js config ls
+echo
+node ./bin/npm.js config ls