diff options
author | Trent Mick <trentm@gmail.com> | 2011-07-20 02:29:03 +0400 |
---|---|---|
committer | isaacs <i@izs.me> | 2011-07-20 02:52:47 +0400 |
commit | 4f967c1b9833a09dc2ff6eb1d1e55ce0fd0de69d (patch) | |
tree | c9ee6b1fa5566e277b94eb04ee5ac22744fa7514 /scripts | |
parent | e985c2f66da5853a7809addab34b63f636898af7 (diff) |
Fix #1163: clean-old.sh breakage on ancient /bin/sh
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/clean-old.sh | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/scripts/clean-old.sh b/scripts/clean-old.sh index d07c218f8..875428cfb 100644 --- a/scripts/clean-old.sh +++ b/scripts/clean-old.sh @@ -16,7 +16,7 @@ if [ $? -ne 0 ]; then fi fi -if ! [ "x$npm_config_prefix" = "x" ]; then +if [ "x$npm_config_prefix" != "x" ]; then PREFIXES=$npm_config_prefix else node="$NODE" @@ -35,7 +35,7 @@ else PREFIXES=$PREFIX altprefix=`"$node" -e process.installPrefix` - if ! [ "x$altprefix" = "x" ] && ! [ "x$altprefix" = "x$PREFIX" ]; then + if [ "x$altprefix" != "x" ] && [ "x$altprefix" != "x$PREFIX" ]; then echo "altprefix=$altprefix" PREFIXES="$PREFIX $altprefix" fi @@ -57,7 +57,7 @@ echo "This script will find and eliminate any shims, symbolic" echo "links, and other cruft that was installed by npm 0.x." echo "" -if ! [ "x$packages" = "x" ]; then +if [ "x$packages" != "x" ]; then echo "The following packages appear to have been installed with" echo "an old version of npm, and will be removed forcibly:" for pkg in $packages; do @@ -73,7 +73,7 @@ if [ "x$1" = "x-y" ]; then OK="yes" fi -while ! [ "$OK" = "y" ] && ! [ "$OK" = "yes" ] && ! [ "$OK" = "no" ]; do +while [ "$OK" != "y" ] && [ "$OK" != "yes" ] && [ "$OK" != "no" ]; do echo "Is this OK? enter 'yes' or 'no' " read OK done @@ -90,18 +90,18 @@ for prefix in $PREFIXES; do for folder in share/man bin lib/node; do find $prefix/$folder -type l | while read file; do target=`$readlink $file | grep '/\.npm/'` - if ! [ "x$target" = "x" ]; then + if [ "x$target" != "x" ]; then # found one! echo rm -rf "$file" rm -rf "$file" # also remove any symlinks to this file. base=`basename "$file"` base=`echo "$base" | awk -F@ '{print $1}'` - if ! [ "x$base" = "x" ]; then + if [ "x$base" != "x" ]; then find "`dirname $file`" -type l -name "$base"'*' \ | while read l; do target=`$readlink "$l" | grep "$base"` - if ! [ "x$target" = "x" ]; then + if [ "x$target" != "x" ]; then echo rm -rf $l rm -rf $l fi @@ -121,7 +121,7 @@ for prefix in $PREFIXES; do done # now remove the package modules, and the .npm folder itself. - if ! [ "x$packages" = "x" ]; then + if [ "x$packages" != "x" ]; then for pkg in $packages; do echo rm -rf $prefix/lib/node/$pkg rm -rf $prefix/lib/node/$pkg |