-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbootstrap.sh
More file actions
executable file
·51 lines (43 loc) · 1.33 KB
/
Copy pathbootstrap.sh
File metadata and controls
executable file
·51 lines (43 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/bash
set -e
echo "🚀 Setting up dotfiles"
if which -s "brew"; then
echo "✅ Homebrew is already installed."
else
echo "🍺 Installing Homebrew"
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
echo "✅ Homebrew installed successfully."
echo "🔧 Configuring Homebrew environment"
if [[ -f /opt/homebrew/bin/brew ]]; then
eval "$(/opt/homebrew/bin/brew shellenv)"
elif [[ -f /home/linuxbrew/.linuxbrew/bin/brew ]]; then
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
fi
fi
if which -s "gpg"; then
echo "✅ GPG is already installed."
else
echo "🔐 Installing GPG"
brew install gnupg
echo "✅ GPG installed successfully."
fi
if which -s "chezmoi"; then
echo "✅ Chezmoi is already installed."
else
echo "⚪️ Installing Chezmoi"
brew install chezmoi
fi
if [ -d "$HOME/.local/share/chezmoi/.git" ]; then
echo "ℹ️ Chezmoi already initialized, pulling latest changes..."
chezmoi update
echo "✅ Chezmoi updated"
else
echo "🗝️ Setting up GPG key"
gpg --import ~/privatekey.asc
gpg --import ~/publickey.asc
export PASS_GPG_KEY=$(gpg --list-keys --keyid-format long --with-colons | grep '^pub' | cut -d: -f5)
echo "🔧 Initializing Chezmoi"
chezmoi init $GITHUB_USERNAME
chezmoi apply
echo "✅ Chezmoi initialized"
fi