From 668d24cb7f55536c8af5d9d1dab496884d9c70cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robin=20B=C3=A4rtschi?= Date: Sat, 5 Jul 2025 16:49:14 +0200 Subject: [PATCH] git --- install.sh | 3 +++ programs/git.sh | 11 +++++++++++ std.sh | 34 ++++++++++++++++++++++++++++++++++ 3 files changed, 48 insertions(+) create mode 100755 install.sh create mode 100755 programs/git.sh create mode 100755 std.sh diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..e4383c3 --- /dev/null +++ b/install.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +./programs/git.sh diff --git a/programs/git.sh b/programs/git.sh new file mode 100755 index 0000000..23e7eb0 --- /dev/null +++ b/programs/git.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +. "std.sh" +program_begin git + +pacinstall git +git config --global init.defaultBranch main +git config --global user.email "robaertschi@proton.me" +git config --global user.name "Robin Bärtschi" + +program_end git diff --git a/std.sh b/std.sh new file mode 100755 index 0000000..9435827 --- /dev/null +++ b/std.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash + +# Intendet to be sourced + +function info() { + echo "INFO: " $@ +} + +function verbose() { + if [[ -n "${DOTI_VERBOSE}" ]]; then + echo "VERBOSE: " $@ + fi +} + +function pacinstall() { + local program=$1 + pacman -Q ${program} &> /dev/null + if [[ "$?" -ne "0" ]]; then + info "Installing ${program}" + sudo pacman -S --noconfirm ${program} + else + verbose "${program} already installed." + fi +} + +function program_begin() { + local program=$1 + info "Installing and configuring ${program}" +} + +function program_end() { + local program=$1 + verbose "${program} done" +}