summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2025-09-24 08:53:24 +0100
committerLeah Rowe <leah@libreboot.org>2025-09-24 08:53:24 +0100
commit03bf6c185b96e631d0f52a67b685628514b3776c (patch)
treece3f14d4d44d2d6d8ae106e9fd5385fa9e84d0d1 /mk
parent0275c60111be536bc1d775d572ddaa34899886ab (diff)
mk: unroll condensed code lines
Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'mk')
-rwxr-xr-xmk43
1 files changed, 34 insertions, 9 deletions
diff --git a/mk b/mk
index 3a3105de..9a75253f 100755
--- a/mk
+++ b/mk
@@ -6,8 +6,15 @@
set -u -e
ispwd="true"
-[ "$0" = "./mk" ] || ispwd="false"
-[ "$ispwd" = "true" ] && [ -L "mk" ] && ispwd="false"
+
+if [ "$0" != "./mk" ]; then
+ ispwd="false"
+fi
+
+if [ "$ispwd" = "true" ] && [ -L "mk" ]; then
+ ispwd="false"
+fi
+
if [ "$ispwd" = "false" ]; then
printf "You must run this in the proper work directory.\n" 1>&2
exit 1
@@ -24,22 +31,40 @@ fi
main()
{
- cmd="" && [ $# -gt 0 ] && cmd="$1" && shift 1
+ cmd=""
+ if [ $# -gt 0 ]; then
+ cmd="$1"
+ shift 1
+ fi
case "$cmd" in
- version) printf "%s\nWebsite: %s\n" "$relname" "$projectsite" ;;
- release|download|inject) $cmd "$@" ;;
- -*) return 1 ;;
- *) err "bad command" main "$@" ;;
+ version)
+ printf "%s\nWebsite: %s\n" "$relname" "$projectsite"
+ ;;
+ release|download|inject)
+ $cmd "$@"
+ ;;
+ -*)
+ return 0
+ ;;
+ *)
+ err "bad command" main "$@"
+ ;;
esac
- set -u -e # some commands disable them. turn them on!
+
+ # some commands disable them. turn them back on!
+ set -u -e
+
+ return 1
}
-main "$@" && exit 0
+main "$@" || exit 0
. "include/tree.sh"
trees "$@" || exit 0
+
x_ touch "$mkhelpercfg"
+
. "$mkhelpercfg"
$cmd