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>2012-07-13 22:46:25 +0400
committerisaacs <i@izs.me>2012-07-13 22:50:29 +0400
commit0519ad865cf84bb64e5819c68510909df73cb4c4 (patch)
treefdd02288b6b039b82e7be41d012f9e897db8aaaa /scripts
parentd87712eecb049ed47fbd3a5aa1da505ebcd11a2f (diff)
Fix relocate script properly
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/relocate.sh5
1 files changed, 3 insertions, 2 deletions
diff --git a/scripts/relocate.sh b/scripts/relocate.sh
index 39e5d7bc8..b7483f296 100755
--- a/scripts/relocate.sh
+++ b/scripts/relocate.sh
@@ -9,12 +9,12 @@
# bash /path/to/npm/scripts/relocate.sh $nodepath
# If $nodepath is blank, then it'll use /usr/bin/env
-dir="$(dirname "$0")"
+dir="$(dirname "$(dirname "$0")")"
cli="$dir"/bin/npm-cli.js
tmp="$cli".tmp
node="$1"
-if [ -n "$node" ]; then
+if [ "x$node" = "x" ]; then
node="/usr/bin/env node"
fi
node="#!$node"
@@ -23,3 +23,4 @@ sed -e 1d "$cli" > "$tmp"
echo "$node" > "$cli"
cat "$tmp" >> "$cli"
rm "$tmp"
+chmod ogu+x $cli