From e3d6596c981bb5b2d640ce3d07985251ad9752c7 Mon Sep 17 00:00:00 2001 From: Omer Kilic Date: Fri, 7 Nov 2014 18:49:03 +0000 Subject: refuse installation in $HOME. --- kerl | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'kerl') diff --git a/kerl b/kerl index 1a01a28..d65439c 100755 --- a/kerl +++ b/kerl @@ -725,12 +725,22 @@ case "$1" in exit 1 fi if [ $# -eq 3 ]; then - do_install $2 "$3" + if [ "$3" = "$HOME" ]; then + echo "Refusing to install in $HOME, this is a bad idea." + exit 1 + else + do_install $2 "$3" + fi else if [ -z "$KERL_DEFAULT_INSTALL_DIR" ]; then - do_install $2 . + if [ "$PWD" = "$HOME" ]; then + echo "Refusing to install in $HOME, this is a bad idea." + exit 1 + else + do_install $2 . + fi else - do_install $2 "$KERL_DEFAULT_INSTALL_DIR/$2" + do_install $2 "$KERL_DEFAULT_INSTALL_DIR/$2" fi fi ;; -- cgit v1.2.3