aboutsummaryrefslogtreecommitdiff
path: root/bootstrap
diff options
context:
space:
mode:
authorThomas Schmucker <ts@its1.de>2026-07-28 08:17:31 +0200
committerThomas Schmucker <ts@its1.de>2026-07-28 08:17:31 +0200
commit24b2283b318fb0e68342e77c13ab220f77db4de1 (patch)
tree340bf7159a8abf6ef25ee61d2389f5b6d1e39c0c /bootstrap
parent6b347041dabee4b128b8778041d6ab8158fb0d13 (diff)
downloaddotfiles-24b2283b318fb0e68342e77c13ab220f77db4de1.tar.gz
dotfiles-24b2283b318fb0e68342e77c13ab220f77db4de1.tar.bz2
dotfiles-24b2283b318fb0e68342e77c13ab220f77db4de1.zip
bootstrap: git.sh und git.ps1 hinzugefuegt (git + delta), Doku angepasst
Diffstat (limited to 'bootstrap')
-rwxr-xr-xbootstrap/git.sh78
1 files changed, 78 insertions, 0 deletions
diff --git a/bootstrap/git.sh b/bootstrap/git.sh
new file mode 100755
index 0000000..36d7067
--- /dev/null
+++ b/bootstrap/git.sh
@@ -0,0 +1,78 @@
1#!/bin/sh
2
3set -eu
4
5OS="$(uname -s)"
6
7die() {
8 printf 'Fehler: %s\n' "$*" >&2
9 exit 1
10}
11
12have() {
13 command -v "$1" >/dev/null 2>&1
14}
15
16check_prerequisites() {
17 case "$OS" in
18 Darwin)
19 if ! have brew; then
20 die "Homebrew ist nicht installiert."
21 fi
22 ;;
23 FreeBSD)
24 if ! have doas; then
25 die "doas ist nicht installiert."
26 fi
27 ;;
28 *)
29 die "Nicht unterstütztes Betriebssystem: $OS"
30 ;;
31 esac
32}
33
34setup_homebrew_env() {
35 case "$OS" in
36 Darwin)
37 export HOMEBREW_NO_AUTO_UPDATE=1
38 export HOMEBREW_NO_INSTALL_CLEANUP=1
39 ;;
40 esac
41}
42
43install_pkg() {
44 binary="$1"
45 package="$2"
46
47 if have "$binary"; then
48 printf "✓ %-32s vorhanden\n" "$binary"
49 return
50 fi
51
52 printf "→ Installiere %s\n" "$package"
53
54 case "$OS" in
55 Darwin)
56 brew install "$package"
57 ;;
58 FreeBSD)
59 doas pkg install -y "$package"
60 ;;
61 esac
62}
63
64install_prerequisites() {
65 install_pkg git git
66 install_pkg delta git-delta
67}
68
69main() {
70 check_prerequisites
71 setup_homebrew_env
72
73 install_prerequisites
74
75 printf "\nBootstrap abgeschlossen.\n"
76}
77
78main "$@"