fix existing file condition

This commit is contained in:
Ben Harris 2020-06-10 21:23:55 -04:00
parent a137bff6c0
commit f94ce2dfe3
1 changed files with 2 additions and 2 deletions

4
tilde
View File

@ -111,9 +111,9 @@ _EOF_
verify_script_name() { verify_script_name() {
[[ $1 == "" ]] && error_exit "please start over and enter the script name" [[ $1 == "" ]] && error_exit "please start over and enter the script name"
[[ $(type -P "$1") ]] && if [[ $(type "$1" > /dev/null 2>&1) ]]; then
[[ -x $HOME/bin/$1 ]] ||
error_exit "$1 already exists. rename your script and try again." 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." [[ -x /tilde/bin/$1 ]] && error_exit "$1 is already taken. rename your script and try again."
case $1 in case $1 in
about|description|list|ls|submit|about|help|apropos|submit|approve) about|description|list|ls|submit|about|help|apropos|submit|approve)