diff options
author | isaacs <i@izs.me> | 2011-05-01 02:21:00 +0400 |
---|---|---|
committer | isaacs <i@izs.me> | 2011-05-01 02:28:52 +0400 |
commit | 1cdc0cbb4afc5381abe0559e3109bc8496846ac4 (patch) | |
tree | b42b871edce7212fec1bdf9a94223fb0efc11634 /scripts | |
parent | e9eca784420b041b8efe733e1ca0f77b3dc2a797 (diff) |
Ask for permission before cleaning old cruft
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/install.sh | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/scripts/install.sh b/scripts/install.sh index ffdbe9340..c18cb641e 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -1,5 +1,14 @@ #!/bin/sh +if [ "x$0" = "xsh" ]; then + # run as curl | sh + cat > npm-install-$$.sh + sh npm-install-$$.sh + ret=$? + rm npm-install-$$.sh + exit $ret +fi + if ! [ "x$NPM_DEBUG" = "x" ]; then set +x fi @@ -111,8 +120,16 @@ cd "$TMP" \ ret=0 if [ $isnpm10 -eq 1 ] && [ -f "scripts/clean-old.sh" ]; then - NODE=$node /bin/sh "scripts/clean-old.sh" - ret=$? + if ! [ "x$skipclean" = "x" ]; then + echo "Skipping 0.x cruft clean" >&2 + ret=0 + elif [ "x$clean" = "xy" ] || [ "x$clean" = "xyes" ]; then + NODE=$node /bin/sh "scripts/clean-old.sh" "-y" + ret=$? + else + NODE=$node /bin/sh "scripts/clean-old.sh" </dev/tty + ret=$? + fi fi if [ $ret -ne 0 ]; then echo "Aborted 0.x cleanup. Exiting." >&2 |