diff options
-rwxr-xr-x | .gitcheck | 31 | ||||
-rwxr-xr-x | build | 4 | ||||
-rwxr-xr-x | download | 5 |
3 files changed, 40 insertions, 0 deletions
diff --git a/.gitcheck b/.gitcheck new file mode 100755 index 00000000..7b77c1bc --- /dev/null +++ b/.gitcheck @@ -0,0 +1,31 @@ +#!/usr/bin/env bash +# SPDX-FileCopyrightText: 2022 Caleb La Grange <thonkpeasant@protonmail.com> +# SPDX-License-Identifier: GPL-3.0-only + +Set_placeholder(){ + git config user.name || git config user.name 'osbmkplaceholder' + git config user.email || git config user.email 'placeholder@osbmkplaceholder.com' +} + +Clean(){ + if [ "$(git config user.name)" = "osbmkplaceholder" ]; then + git config --unset user.name + fi + + if [ "$(git config user.email)" = "placeholder@osbmkplaceholder.com" ]; then + git config --unset user.email + fi +} + +Run(){ +if [ "${1}" = "clean" ]; then + Clean +else + # Check if username and or email is set. + if ! git config user.name || git config user.email ; then + Set_placeholder + fi +fi +} + +Run >/dev/null @@ -5,6 +5,7 @@ # Copyright (C) 2014, 2015, 2020, 2021 Leah Rowe <info@minifree.org> # Copyright (C) 2015 Patrick "P. J." McDermott <pj@pehjota.net> # Copyright (C) 2015, 2016 Klemens Nanni <contact@autoboot.org> +# Copyright (C) 2022, Caleb La Grange <thonkpeasant@protonmail.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -19,6 +20,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. # +./.gitcheck [ "x${DEBUG+set}" = 'xset' ] && set -v set -u -e @@ -105,3 +107,5 @@ else help exit 0 fi + +./.gitcheck clean @@ -5,6 +5,7 @@ # Copyright (C) 2014, 2015, 2020, 2021 Leah Rowe <info@minifree.org> # Copyright (C) 2015 Patrick "P. J." McDermott <pj@pehjota.net> # Copyright (C) 2015, 2016 Klemens Nanni <contact@autoboot.org> +# Copyright (C) 2022, Caleb La Grange <thonkpeasant@protonmail.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -20,6 +21,8 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. # +./.gitcheck + [ "x${DEBUG+set}" = 'xset' ] && set -v set -u -e @@ -112,3 +115,5 @@ else fi exit 0 + +./.gitcheck clean |