From 29c2dbcb86fa3b06deb0661037c636bd07e043c2 Mon Sep 17 00:00:00 2001 From: Nikurasu Date: Fri, 10 May 2024 09:47:45 +0200 Subject: [PATCH] feat(bash): custom git init Wrapper arround git that executes a customized git init that asks for a username and email --- bash/tamakirc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/bash/tamakirc b/bash/tamakirc index 6a61875..a2aef61 100644 --- a/bash/tamakirc +++ b/bash/tamakirc @@ -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 +}