-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.sh
executable file
·121 lines (105 loc) · 2.51 KB
/
setup.sh
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
#!/bin/bash
# Get the directory that the setup.sh is located in
SETUP_FILE_LOCATION=$(cd "$(dirname "$0")" && pwd)
# Install brew if not installed
brew_install_path="/opt/homebrew/bin/brew"
if [ ! -f "$brew_install_path" ]; then
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
fi
# Install packages
packages=(
# CLI Tools
"bat"
"git-delta"
"curl"
"eza"
"fd"
"fzf"
"git"
"gum"
"htop"
"jq"
"ripgrep"
"siege"
"tree"
"watch"
"wget"
"zoxide"
"zsh"
"tmux"
"oh-my-posh"
"reattach-to-user-namespace"
"nowplaying-cli"
"bash"
"bc"
"coreutils"
"gawk"
"gh"
"glab"
"gsed"
"gum"
# Programming Languages and Package Managers
"composer"
"node"
"php"
"python"
"python3"
"yarn"
# PHP-related
"composer"
"php"
# Development and Deployment Tools
"devspace"
"helm"
"kubectl"
"kubectx"
"neovim"
"rclone"
"terraform"
"alacritty"
# GNU Tools
"gnu-getopt"
"gnu-indent"
"gnu-sed"
"gnu-tar"
"stow"
# Fonts
"homebrew/cask/font-monaspace-nerd-font"
"homebrew/cask/font-noto-sans-symbols-2"
# Applications
"1password"
"visual-studio-code"
"zed"
)
# Install packages
brew install -q "${packages[@]}"
# Tmux
mkdir -p ~/.tmux/plugins
if [ ! -d ~/.tmux/plugins/tpm ]; then
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
else
cd ~/.tmux/plugins/tpm || exit
git pull
fi
# For each extension in the vscode.extensions.txt file, install them with code --install-extension
EXTENSION_FILE="$SETUP_FILE_LOCATION/vscode.extensions.txt"
while IFS= read -r line; do
# Check if the extension is already installed, if it is then skip it silently
if code --list-extensions | grep -q "$line"; then
continue
fi
code --install-extension "$line"
done <"$EXTENSION_FILE"
# Symlink the dotfiles
stow . -t ~
# Check if the ~/.gitconfig-user file exists, otherwise prompt to make it
if [ ! -f ~/.gitconfig-user ]; then
createGitConfigUserFile=$(gum confirm "Would you like to create a ~/.gitconfig-user file? (y/n)")
if [ $? -eq 0 ]; then
name=$(gum input --prompt "What is your name? " --placeholder "")
email=$(gum input --prompt "What is your email? " --placeholder "")
echo "[user]" > ~/.gitconfig-user
echo " name = $name" >> ~/.gitconfig-user
echo " email = $email" >> ~/.gitconfig-user
fi
fi