From a41f19ab2b556f3e6497c3a665096ba15ebd1ceb Mon Sep 17 00:00:00 2001 From: root Date: Tue, 30 Aug 2022 00:56:27 +0000 Subject: [PATCH] Add setopt nomatch --- sh/load.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/sh/load.sh b/sh/load.sh index 94d505c..b91237f 100755 --- a/sh/load.sh +++ b/sh/load.sh @@ -5,10 +5,14 @@ TOOLKIT=/etc/toolkit +setopt +o nomatch + load_scripts_in_dir() { - for sh in ${TOOLKIT}/sh/custom/*.sh; do - test -r "$sh" && . "$sh" - done + if [[ -d $1 ]]; then + for sh in $1/*.sh; do + test -r "$sh" && . "$sh" + done + fi } create_dir_if_not_exists() {