feat(bash): custom git init

Wrapper arround git that executes a customized git init that asks for a username and email
This commit is contained in:
Nikurasu 2024-05-10 09:47:45 +02:00
parent 99a4e18666
commit 29c2dbcb86
Signed by: Nikurasu
GPG key ID: 9E7F14C03EF1F271

View file

@ -41,3 +41,17 @@ function tp {
echo -e "[Trash Info]\nPath=$(realpath $1)\nDeletionDate=$(date "+%Y-%m-%dT%H:%M:%S")" > $HOME/.local/share/Trash/info/$(basename $1).trashinfo
gum style --bold --border rounded --border-foreground "#F5A9B8" --foreground "#5BCEFA" "$(basename $1) has been thrown in the bin"
}
git() {
if [[ $1 == "init" ]]; then
shift
gituser=$(gum input --prompt "Git user for new repo: " --placeholder "user")
gitemail=$(gum input --prompt "Git email for new repo: " --placeholder "email")
command git init "$@"
command git config user.name $gituser
command git config user.email $gitemail
else
command git "$@"
fi
}