diff options
author | Evax Software <[email protected]> | 2011-04-07 10:42:47 +0200 |
---|---|---|
committer | Evax Software <[email protected]> | 2011-04-07 10:47:31 +0200 |
commit | 6655e7c48502fdee6e1d85d573a5569cd5b16e0c (patch) | |
tree | 722cd8a4c69ee220d8cef25a227b2f93c461a8e8 | |
parent | 1f63ccc22740e89ea17abef40773c197b29d7a59 (diff) | |
download | kerl-6655e7c48502fdee6e1d85d573a5569cd5b16e0c.tar.gz kerl-6655e7c48502fdee6e1d85d573a5569cd5b16e0c.tar.bz2 kerl-6655e7c48502fdee6e1d85d573a5569cd5b16e0c.zip |
Fix trailing slash issue in "kerl remove installation"
-rwxr-xr-x | kerl | 16 |
1 files changed, 9 insertions, 7 deletions
@@ -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 |