diff options
author | Yurii Rashkovskii <[email protected]> | 2014-11-08 05:36:45 +0700 |
---|---|---|
committer | Yurii Rashkovskii <[email protected]> | 2014-11-08 05:36:45 +0700 |
commit | c084f62b52b713c07954fa98ec278ca6483b7ce4 (patch) | |
tree | bff2f665664b827bb35a72f91cb8991f4059496e /kerl | |
parent | eb42d883c28c09c8c18ac2834ed58596771452cc (diff) | |
parent | e3d6596c981bb5b2d640ce3d07985251ad9752c7 (diff) | |
download | kerl-c084f62b52b713c07954fa98ec278ca6483b7ce4.tar.gz kerl-c084f62b52b713c07954fa98ec278ca6483b7ce4.tar.bz2 kerl-c084f62b52b713c07954fa98ec278ca6483b7ce4.zip |
Merge pull request #87 from omerk/master
Refuse installation in $HOME
Diffstat (limited to 'kerl')
-rwxr-xr-x | kerl | 16 |
1 files changed, 13 insertions, 3 deletions
@@ -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 ;; |