mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-11 14:02:52 +02:00
9457d6be52
e.g. ./build boot roms list ./update blobs inject listboards ./build boot list ./build clean list also this is now possible: ./build list or maybe ./update list ^ would list directories in resources/scripts/build and resources/scripts/update respectively this script is added: resources/scripts/build/command/options call it like so, e.g. ./build command options resources/coreboot this script is now used, for list functions in other scripts. Signed-off-by: Leah Rowe <leah@libreboot.org>
32 lines
538 B
Bash
Executable File
32 lines
538 B
Bash
Executable File
#!/usr/bin/env sh
|
|
|
|
# Copyright (c) 2023 Leah Rowe <info@minifree.org>
|
|
# SPDX-License-Identifier: MIT
|
|
|
|
. "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##*/}"
|
|
items=0
|
|
done
|
|
return ${items}
|
|
}
|
|
|
|
main $@
|