123456789101112131415161718192021222324252627282930313233343536 |
- #!/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 [ ! -d ".git/" ]; then
- git init
- fi
- 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
|