aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Allen <[email protected]>2017-11-13 09:30:57 +0530
committerMark Allen <[email protected]>2017-11-13 09:30:57 +0530
commit1086cbaf29f38ff620f7b5ad689fad50ef97572d (patch)
treedda1513274049a812a771600bd21b27d882eee46
parent05955483cf2296b52f410e94b6c8d9af7cf7da32 (diff)
parente7c67cb8ada4c3f7aea07475ee4847ed686d5858 (diff)
downloadkerl-1086cbaf29f38ff620f7b5ad689fad50ef97572d.tar.gz
kerl-1086cbaf29f38ff620f7b5ad689fad50ef97572d.tar.bz2
kerl-1086cbaf29f38ff620f7b5ad689fad50ef97572d.zip
Merge branch 'essen-fix-delete-installation'
-rwxr-xr-xkerl18
1 files changed, 15 insertions, 3 deletions
diff --git a/kerl b/kerl
index 9b7bf40..f48da1c 100755
--- a/kerl
+++ b/kerl
@@ -301,7 +301,7 @@ is_valid_installation()
name=$(echo "$l" | cut -d " " -f 1)
path=$(echo "$l" | cut -d " " -f 2)
if [ "$name" = "$1" -o "$path" = "$1" ]; then
- if [ -f "$1"/activate ]; then
+ if [ -f "$path"/activate ]; then
return 0
fi
fi
@@ -1587,6 +1587,14 @@ get_name_from_install_path()
return 0
}
+get_install_path_from_name()
+{
+ if [ -f "$KERL_BASE_DIR"/otp_installations ]; then
+ grep -m1 -E "$1$" "$KERL_BASE_DIR"/otp_installations | cut -d' ' -f2
+ fi
+ return 0
+}
+
do_active()
{
ACTIVE_PATH="$(get_active_path)"
@@ -2002,10 +2010,14 @@ case "$1" in
;;
installation)
assert_valid_installation "$3"
- maybe_remove "$3"
+ if [ -d "$3" ]; then
+ maybe_remove "$3"
+ else
+ maybe_remove "$(get_install_path_from_name "$3")"
+ fi
escaped="$(echo "$3" | sed $SED_OPT -e 's#/$##' -e 's#\/#\\\/#g')"
list_remove "$2"s "$escaped"
- echo "The installation in $3 has been deleted"
+ echo "The installation \"$3\" has been deleted"
;;
*)
echo "Cannot delete $2"