summaryrefslogtreecommitdiff
path: root/include/option.sh
diff options
context:
space:
mode:
Diffstat (limited to 'include/option.sh')
-rwxr-xr-xinclude/option.sh18
1 files changed, 18 insertions, 0 deletions
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 <leah@libreboot.org>
+
+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}
+}