Skip to content

Commit

Permalink
refuse installation in $HOME.
Browse files Browse the repository at this point in the history
  • Loading branch information
omerk committed Nov 7, 2014
1 parent eb42d88 commit e3d6596
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions kerl
Expand Up @@ -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
;;
Expand Down

0 comments on commit e3d6596

Please sign in to comment.