summaryrefslogtreecommitdiff
path: root/checkgit
blob: a1f900c3d53a3561a7306cd5c246a831a1473b33 (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
#!/usr/bin/env sh
# SPDX-License-Identifier: MIT
# SPDX-FileCopyrightText: 2023 Leah Rowe <leah@libreboot.org>

. "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}" 1>&2
	err "Misconfigured git-scm"
}

main $@