-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall_macos.sh
91 lines (73 loc) · 2.88 KB
/
install_macos.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
#!/usr/bin/env bash
set -e
if [[ $(uname -s) != "Darwin" ]]; then
echo "You are not running macOS. Why are you trying to run this script?"
exit 1
fi
echo "#########################################################"
echo "# ensure all submodules exist #"
echo "#########################################################"
git submodule update --init --recursive
echo "#########################################################"
echo "# ensure dirs exist #"
echo "#########################################################"
if [ ! -d "$HOME" ]; then
echo "ERROR: \$HOME is not set!"
exit 1
fi
if [ ! -d "$HOME/.config" ]; then
mkdir -p "$HOME/.config"
fi
echo "#########################################################"
echo "# Install Software #"
echo "#########################################################"
echo "* install fzf"
if [ -d "$HOME/.config/fzf/" ]; then
pushd "$HOME/.config/fzf"
git pull && "$HOME/.config/fzf/install" --bin
popd
else
git clone --depth 1 https://github.com/junegunn/fzf.git "$HOME/.config/fzf" && "$HOME/.config/fzf/install" --bin
fi
if [[ ! $(command -v brew) ]]; then
echo "* Install homebrew"
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
fi
echo "* install eza python3 neovim tfswitch ripgrep iproute2mac zsh thefuck sops watch wget ansible navi zoxide tmux git-delta node@20"
brew install eza python3 neovim tfswitch ripgrep iproute2mac zsh thefuck sops watch wget ansible navi zoxide tmux git-delta bat node@20
echo "* install gnutils"
brew install coreutils findutils gnu-tar gnu-sed gawk gnutls gnu-indent gnu-getopt grep
echo "* install kubernetes tools"
brew install kubectl helm k9s stern hcloud
echo "* Install oh-my-posh"
brew tap jandedobbeleer/oh-my-posh
brew install oh-my-posh
echo "install krew"
(
set -x
cd "$(mktemp -d)" &&
OS="$(uname | tr '[:upper:]' '[:lower:]')" &&
ARCH="$(uname -m | sed -e 's/x86_64/amd64/' -e 's/\(arm\)\(64\)\?.*/\1\2/' -e 's/aarch64$/arm64/')" &&
KREW="krew-${OS}_${ARCH}" &&
curl -fsSLO "https://github.com/kubernetes-sigs/krew/releases/latest/download/${KREW}.tar.gz" &&
tar zxvf "${KREW}.tar.gz" &&
./"${KREW}" install krew
)
if [[ ! $(command -v go) ]]; then
echo "* Install GoLang"
sudo ./update-golang/update-golang.sh
elif [[ ! ($(go version | awk '{print $3}') =~ go1.22.*) ]]; then
echo "* updating GoLang"
sudo ./update-golang/update-golang.sh
else
echo "* GoLang installed & up to date"
fi
if [[ ! $(command -v cargo) ]]; then
echo "* Install Rust/Cargo"
curl https://sh.rustup.rs -sSf | sh
fi
echo "* Install hcloud completion"
if [[ $(command -v hcloud) ]]; then
mkdir -p ~/.config/hcloud/completion/zsh
hcloud completion zsh >~/.config/hcloud/completion/zsh/_hcloud
fi