Files
lbmk/checkgit
Riku Viitanen ef3fb05d66 Less cat abuse
More than 90% of cats were thus terminated.
read (shell built-in) is better at reading, and dogs are better pets.

Signed-off-by: Riku Viitanen <riku.viitanen@protonmail.com>
2023-09-03 17:00:21 +03:00

28 lines
689 B
Bash
Executable File

#!/usr/bin/env sh
# SPDX-FileCopyrightText: 2023 Leah Rowe <leah@libreboot.org>
# SPDX-License-Identifier: MIT
. "include/err.sh"
read projectname < projectname
main()
{
which git 1>/dev/null 2>/dev/null || \
fail "git not installed. please install git-scm."
git config --global user.name 1>/dev/null 2>/dev/null || \
fail "git config --global user.name \"John Doe\""
git config --global user.email 1>/dev/null 2>/dev/null || \
fail "git config --global user.email \"john.doe@example.com\""
}
fail()
{
printf "You must configure Git, before using %s's build system. Do:\n" \
"${projectname}" 1>&2
printf "%s\n\n" "${1}"
err "Misconfigured git-scm"
}
main $@