2022-12-16 18:45:54 +00:00
|
|
|
#!/bin/sh
|
2022-03-15 18:02:04 +00:00
|
|
|
# SPDX-FileCopyrightText: 2022 Caleb La Grange <thonkpeasant@protonmail.com>
|
|
|
|
# SPDX-License-Identifier: GPL-3.0-only
|
|
|
|
|
|
|
|
Set_placeholder(){
|
2022-11-21 02:42:31 +00:00
|
|
|
# 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
|
2022-03-15 18:02:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Clean(){
|
2022-11-15 10:21:57 +00:00
|
|
|
if [ "$(git config user.name)" = "lbmkplaceholder" ]; then
|
2022-03-15 18:02:04 +00:00
|
|
|
git config --unset user.name
|
|
|
|
fi
|
|
|
|
|
2022-11-15 10:21:57 +00:00
|
|
|
if [ "$(git config user.email)" = "placeholder@lbmkplaceholder.com" ]; then
|
2022-03-15 18:02:04 +00:00
|
|
|
git config --unset user.email
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
Run(){
|
2023-05-18 08:25:25 +00:00
|
|
|
if [ $# -gt 0 ]; then
|
|
|
|
if [ "${1}" = "clean" ]; then
|
|
|
|
Clean
|
|
|
|
fi
|
2022-03-15 18:02:04 +00:00
|
|
|
else
|
2022-11-21 02:42:31 +00:00
|
|
|
Set_placeholder
|
|
|
|
|
|
|
|
# Check coreboot as well to prevent errors during building
|
|
|
|
if [ -d coreboot ]; then
|
|
|
|
cd coreboot
|
2022-03-15 18:02:04 +00:00
|
|
|
Set_placeholder
|
2022-11-21 02:42:31 +00:00
|
|
|
cd -
|
2022-03-15 18:02:04 +00:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2023-05-18 08:23:23 +00:00
|
|
|
Run $@ >/dev/null
|