From ecd7f1d11ee6a6b061e49d1402ce6056cca93cb1 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Thu, 18 May 2023 09:41:00 +0100 Subject: .gitcheck: move logic out of main() Signed-off-by: Leah Rowe --- .gitcheck | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/.gitcheck b/.gitcheck index 0bc64fbc..451c516d 100755 --- a/.gitcheck +++ b/.gitcheck @@ -13,23 +13,28 @@ main() clean fi else - set_placeholder - - # Check coreboot as well to prevent errors during building - if [ -d coreboot ]; then - for x in coreboot/*; do - if [ ! -d "${x}" ]; then - continue - fi - cd "${x}" - set_placeholder - cd - - done - fi + set_placeholders + fi +} + +set_placeholders() +{ + set_git_credentials + + # Check coreboot as well to prevent errors during building + if [ -d coreboot ]; then + for x in coreboot/*; do + if [ ! -d "${x}" ]; then + continue + fi + cd "${x}" + set_git_credentials + cd - + done fi } -set_placeholder() +set_git_credentials() { # Check if username and or email is set. if ! git config user.name || git config user.email ; then -- cgit v1.2.1