From 6655e7c48502fdee6e1d85d573a5569cd5b16e0c Mon Sep 17 00:00:00 2001 From: Evax Software Date: Thu, 7 Apr 2011 10:42:47 +0200 Subject: Fix trailing slash issue in "kerl remove installation" --- kerl | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'kerl') diff --git a/kerl b/kerl index f712c6e..71b101f 100755 --- a/kerl +++ b/kerl @@ -335,14 +335,16 @@ ACTIVATE list_print() { if [ -f $KERL_BASE_DIR/otp_$1 ]; then - if [ -z "$2" ]; then - cat $KERL_BASE_DIR/otp_$1 - else - echo `cat $KERL_BASE_DIR/otp_$1` + if [ "`cat "$KERL_BASE_DIR/otp_$1" | wc -l`" != "0" ]; then + if [ -z "$2" ]; then + cat $KERL_BASE_DIR/otp_$1 + else + echo `cat $KERL_BASE_DIR/otp_$1` + fi + return 0 fi - else - echo "There are no $1 available" fi + echo "There are no $1 available" } list_add() @@ -493,7 +495,7 @@ case "$1" in installation) if is_valid_installation "$3"; then rm -Rf "$3" - escaped=`echo "$3" | sed $SED_OPT -e 's#\/#\\\/#g'` + escaped=`echo "$3" | sed $SED_OPT -e 's#/$##' -e 's#\/#\\\/#g'` list_remove $2s "$escaped" echo "The installation in $3 has been deleted" else -- cgit v1.2.3