lbmk/.gitcheck
Ferass 'Vitali64' EL HAFIDI f787044642 Do not rely on bashisms and behaviour undefined by the POSIX specification.
By making lbmk fully POSIX-compliant, it will be easier to port lbmk to
other systems implementing POSIX such as Alpine Linux and FreeBSD.

Signed-off-by: Ferass 'Vitali64' EL HAFIDI <vitali64pmemail@protonmail.com>
2022-12-27 15:50:41 +00:00

39 lines
841 B
Bash
Executable file

#!/bin/sh
# SPDX-FileCopyrightText: 2022 Caleb La Grange <thonkpeasant@protonmail.com>
# SPDX-License-Identifier: GPL-3.0-only
Set_placeholder(){
# Check if username and or email is set.
if ! git config user.name || git config user.email ; then
git config user.name || git config user.name 'lbmkplaceholder'
git config user.email || git config user.email 'placeholder@lbmkplaceholder.com'
fi
}
Clean(){
if [ "$(git config user.name)" = "lbmkplaceholder" ]; then
git config --unset user.name
fi
if [ "$(git config user.email)" = "placeholder@lbmkplaceholder.com" ]; then
git config --unset user.email
fi
}
Run(){
if [ "${1}" = "clean" ]; then
Clean
else
Set_placeholder
# Check coreboot as well to prevent errors during building
if [ -d coreboot ]; then
cd coreboot
Set_placeholder
cd -
fi
fi
}
Run >/dev/null