From d187c37f032d0bd9e083226c3bed1589ec0450c9 Mon Sep 17 00:00:00 2001 From: zerf58 Date: Wed, 2 Jul 2025 09:02:46 -0700 Subject: [PATCH] dont run find_or_open when sourcing --- find_or_open.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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