From f94ce2dfe3a21c9ca4e4ca0e22e62648b13cdcdd Mon Sep 17 00:00:00 2001 From: Ben Harris Date: Wed, 10 Jun 2020 21:23:55 -0400 Subject: [PATCH] fix existing file condition --- tilde | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tilde b/tilde index b584020..6568db9 100755 --- a/tilde +++ b/tilde @@ -111,9 +111,9 @@ _EOF_ verify_script_name() { [[ $1 == "" ]] && error_exit "please start over and enter the script name" - [[ $(type -P "$1") ]] && - [[ -x $HOME/bin/$1 ]] || + if [[ $(type "$1" > /dev/null 2>&1) ]]; then error_exit "$1 already exists. rename your script and try again." + fi [[ -x /tilde/bin/$1 ]] && error_exit "$1 is already taken. rename your script and try again." case $1 in about|description|list|ls|submit|about|help|apropos|submit|approve)