mirror of
https://codeberg.org/canoeboot/cbmk.git
synced 2025-05-12 10:25:37 +01:00

that way, with set -u -e, we aren't risking some buggy sh implementations from causing an error exit where it shouldn't. Signed-off-by: Leah Rowe <leah@libreboot.org>
40 lines
836 B
Bash
Executable file
40 lines
836 B
Bash
Executable file
#!/usr/bin/env sh
|
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
|
# Copyright (c) 2020-2025 Leah Rowe <leah@libreboot.org>
|
|
# Copyright (c) 2022 Caleb La Grange <thonkpeasant@protonmail.com>
|
|
|
|
set -u -e
|
|
|
|
if [ "./${0##*/}" != "${0}" ] || [ ! -f "mk" ] || [ -L "mk" ]; then
|
|
printf "You must run this in the proper work directory.\n" 1>&2
|
|
exit 1
|
|
fi
|
|
|
|
. "include/lib.sh"
|
|
. "include/init.sh"
|
|
. "include/inject.sh"
|
|
. "include/rom.sh"
|
|
. "include/release.sh"
|
|
|
|
main()
|
|
{
|
|
cmd="" && [ $# -gt 0 ] && cmd="$1" && shift 1
|
|
|
|
case "$cmd" in
|
|
version) printf "%s\nWebsite: %s\n" "$relname" "$projectsite" ;;
|
|
release|inject) $cmd "$@" ;;
|
|
-*) return 0 ;;
|
|
*) err "bad command" ;;
|
|
esac
|
|
set -u -e # some commands disable them. turn them on!
|
|
return 1
|
|
}
|
|
|
|
main "$@" || exit 0
|
|
|
|
. "include/git.sh"
|
|
. "include/tree.sh"
|
|
|
|
trees "$@" || exit 0
|
|
. "$mkhelpercfg"
|
|
$cmd
|