diff options
author | Mark Allen <[email protected]> | 2016-05-11 14:09:44 -0500 |
---|---|---|
committer | Mark Allen <[email protected]> | 2016-05-11 14:09:44 -0500 |
commit | 1f7543f617a592c639ea60f0226575dabc676f80 (patch) | |
tree | 847a6382f30c5459e187d9e2a679a7e2fa92370e /kerl | |
parent | 0154d1fe54a68ca2443d959317f7601e57c2bf76 (diff) | |
download | kerl-1f7543f617a592c639ea60f0226575dabc676f80.tar.gz kerl-1f7543f617a592c639ea60f0226575dabc676f80.tar.bz2 kerl-1f7543f617a592c639ea60f0226575dabc676f80.zip |
Canonicalize during deletes too
Diffstat (limited to 'kerl')
-rwxr-xr-x | kerl | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -864,13 +864,16 @@ is_valid_install_path() maybe_remove() { - if [ "$1" = "$HOME" ]; then + candidate=$(realpath "$1") + canonical_home=$(realpath "$HOME") + + if [ "$candidate" = "$canonical_home" ]; then echo "WARNING: You cannot remove an install from $HOME; it's your home directory." return 0 fi ACTIVE_PATH="$(get_active_path)" - if [ "$1" = "$ACTIVE_PATH" ]; then + if [ "$candidate" = "$ACTIVE_PATH" ]; then echo "ERROR: You cannot delete the active installation. Deactivate it first." exit 1 fi |