diff --git a/find_or_open.sh b/find_or_open.sh index 60d73e4..a787092 100755 --- a/find_or_open.sh +++ b/find_or_open.sh @@ -11,7 +11,6 @@ find_or_open(){ } # this can either be sourced by buttons.sh or run as a standalone script -# when running as a standalone, execute it: -if [[ -n $1 ]]; then - find_or_open "$1" +if [ "${BASH_SOURCE[0]}" = "$0" ] && [[ -n $1 ]]; then + find_or_open "$1" fi