blob: 1757b0b4a4560a9796a8f753647c34b5e6a45aaa (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
#!/usr/bin/env sh
# SPDX-License-Identifier: MIT
# SPDX-FileCopyrightText: 2023 Leah Rowe <info@minifree.org>
. "include/err.sh"
items=1
main()
{
[ $# -gt 0 ] || \
err "No argument given"
listitems "${1}" || err "No items present under: ${1}"
}
listitems()
{
[ -d "${1}" ] || \
err "Directory not does exist: ${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
items=0
done
return ${items}
}
main $@
|