check git/version: properly call err()
Signed-off-by: Leah Rowe <leah@libreboot.org>btrfsvols
parent
1223bfaeef
commit
923a96c18e
|
@ -11,7 +11,7 @@ xx_() {
|
||||||
check_git()
|
check_git()
|
||||||
{
|
{
|
||||||
which git 1>/dev/null 2>/dev/null || \
|
which git 1>/dev/null 2>/dev/null || \
|
||||||
err "git not installed. please install git-scm."
|
git_err "git not installed. please install git-scm."
|
||||||
git config --global user.name 1>/dev/null 2>/dev/null || \
|
git config --global user.name 1>/dev/null 2>/dev/null || \
|
||||||
git_err "git config --global user.name \"John Doe\""
|
git_err "git config --global user.name \"John Doe\""
|
||||||
git config --global user.email 1>/dev/null 2>/dev/null || \
|
git config --global user.email 1>/dev/null 2>/dev/null || \
|
||||||
|
@ -20,13 +20,14 @@ check_git()
|
||||||
|
|
||||||
git_err()
|
git_err()
|
||||||
{
|
{
|
||||||
printf "You need to set git name/email, like so:\n%s\n\n" "${1}"
|
printf "You need to set git name/email, like so:\n%s\n\n" "${1}" 1>&2
|
||||||
fail "Git name/email not configured" || \
|
fail "Git name/email not configured" || \
|
||||||
err "Git name/email not configured"
|
err "Git name/email not configured"
|
||||||
}
|
}
|
||||||
|
|
||||||
check_project()
|
check_project()
|
||||||
{
|
{
|
||||||
|
_fail="${1}"
|
||||||
read project < projectname
|
read project < projectname
|
||||||
|
|
||||||
[ -f version ] && read version < version
|
[ -f version ] && read version < version
|
||||||
|
@ -39,8 +40,8 @@ check_project()
|
||||||
[ ! -e ".git" ] || versiondate="$(git show --no-patch --no-notes \
|
[ ! -e ".git" ] || versiondate="$(git show --no-patch --no-notes \
|
||||||
--pretty='%ct' HEAD)" || versiondate="${versiondate_}"
|
--pretty='%ct' HEAD)" || versiondate="${versiondate_}"
|
||||||
|
|
||||||
[ -z ${versiondate} ] && err "Unknown version date"
|
[ -z ${versiondate} ] && "${_fail}" "Unknown version date"
|
||||||
[ -z ${version} ] && err "Unknown version"
|
[ -z ${version} ] && "${_fail}" "Unknown version"
|
||||||
|
|
||||||
printf "%s\n" "${version}" > version
|
printf "%s\n" "${version}" > version
|
||||||
printf "%s\n" "${versiondate}" > versiondate
|
printf "%s\n" "${versiondate}" > versiondate
|
||||||
|
|
Loading…
Reference in New Issue