aboutsummaryrefslogtreecommitdiffstats
path: root/kerl
diff options
context:
space:
mode:
authorEvax Software <[email protected]>2011-04-07 10:42:47 +0200
committerEvax Software <[email protected]>2011-04-07 10:47:31 +0200
commit6655e7c48502fdee6e1d85d573a5569cd5b16e0c (patch)
tree722cd8a4c69ee220d8cef25a227b2f93c461a8e8 /kerl
parent1f63ccc22740e89ea17abef40773c197b29d7a59 (diff)
downloadkerl-6655e7c48502fdee6e1d85d573a5569cd5b16e0c.tar.gz
kerl-6655e7c48502fdee6e1d85d573a5569cd5b16e0c.tar.bz2
kerl-6655e7c48502fdee6e1d85d573a5569cd5b16e0c.zip
Fix trailing slash issue in "kerl remove installation"
Diffstat (limited to 'kerl')
-rwxr-xr-xkerl16
1 files changed, 9 insertions, 7 deletions
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