From 74c48a881df378a83e261c2785012609d81d801e Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Wed, 27 Sep 2023 21:46:20 +0100 Subject: move build/command/options to include/option.sh Signed-off-by: Leah Rowe --- include/option.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 include/option.sh (limited to 'include') diff --git a/include/option.sh b/include/option.sh new file mode 100755 index 00000000..1f4f290f --- /dev/null +++ b/include/option.sh @@ -0,0 +1,18 @@ +# SPDX-License-Identifier: MIT +# SPDX-FileCopyrightText: 2023 Leah Rowe + +listitems() +{ + rval=1 + [ ! -d "${1}" ] && \ + printf "listitems: directory '%s' doesn't exist" "${1}" && \ + return 1 + for x in "${1}/"*; do + # -e used because this is for files *or* directories + [ -e "${x}" ] || continue + [ "${x##*/}" = "build.list" ] && continue + printf "%s\n" "${x##*/}" 2>/dev/null + rval=0 + done + return ${rval} +} -- cgit v1.2.1