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
diff options
context:
space:
mode:
authorisaacs <i@izs.me>2011-01-29 01:08:17 +0300
committerisaacs <i@izs.me>2011-01-29 01:08:36 +0300
commita3bc730303774407543c63c0a16a6da675158be8 (patch)
tree5392af66ad0842c2cb60e075a5c4640658bf4cc4 /scripts
parent67f20b19434694a38277d704e355be110c195cd6 (diff)
Add tar=gtar config if found in installation
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/install.sh18
1 files changed, 16 insertions, 2 deletions
diff --git a/scripts/install.sh b/scripts/install.sh
index ce45e1d7c..7330c689d 100755
--- a/scripts/install.sh
+++ b/scripts/install.sh
@@ -21,13 +21,27 @@ if [ $? -ne 0 ]; then
fi
BACK="$PWD"
+
+# sniff for gtar/gegrep/gmake
+# use which, but don't trust it very much.
+
tar="${TAR}"
if [ -z "$tar" ]; then
- # sniff for gtar/gegrep
- # use which, but don't trust it very much.
tar=`which gtar 2>&1`
if [ $? -ne 0 ] || ! [ -x $tar ]; then
tar=tar
+ else
+ # tar is used by npm, so let's set the config all over the place.
+ # This isn't guaranteed to work, but it is very likely.
+ if [ -d $HOME ]; then
+ echo "tar = $tar" >> $HOME/.npmrc
+ fi
+ globalconfig=`dirname "$node"`
+ globalconfig=`dirname "$globalconfig"`
+ globalconfig="$globalconfig"/etc/npmrc
+ echo "tar = $tar" >> $globalconfig
+
+ echo "It would be wise to add 'TAR=$tar' to your environment." >&2
fi
fi