-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.sh
More file actions
executable file
·109 lines (93 loc) · 2.73 KB
/
Copy pathinit.sh
File metadata and controls
executable file
·109 lines (93 loc) · 2.73 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
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
#!/bin/sh
usage() {
echo "Usage: $0 -s <shell> [-d <dotfiles_dir>]"
echo " -s Shell to configure: 'bash' or 'zsh'"
echo " -d Dotfiles location (default: \$HOME/.dotfiles)"
exit 1
}
DOTFILES_LOCATION="$HOME/.dotfiles"
SHELL_CHOICE=""
while getopts "s:d:" opt; do
case $opt in
s) SHELL_CHOICE="$OPTARG" ;;
d) DOTFILES_LOCATION="$OPTARG" ;;
*) usage ;;
esac
done
if [ -z "$SHELL_CHOICE" ]; then
echo "Error: shell is required"
usage
fi
case $SHELL_CHOICE in
bash|zsh) ;;
*) echo "Error: unsupported shell '$SHELL_CHOICE' (use 'bash' or 'zsh')"; usage ;;
esac
echo "Using shell: $SHELL_CHOICE"
echo "Using dotfiles location: $DOTFILES_LOCATION"
# Remove any previous config
[ -f $HOME/.gitconfig ] && rm $HOME/.gitconfig
[ -f $HOME/.profile ] && rm $HOME/.profile
[ -f $HOME/.bashrc ] && cp $HOME/.bashrc $HOME/.bashrc.bkp && rm $HOME/.bashrc
[ -f $HOME/.zshrc ] && cp $HOME/.zshrc $HOME/.zshrc.bkp && rm $HOME/.zshrc
[ -f $HOME/.vimrc ] && rm $HOME/.vimrc
[ -f $HOME/.tmux.conf ] && rm $HOME/.tmux.conf
[ -f $HOME/.vim ] && rm -r "$HOME/.vim"
# link vim & tmux config
ln -s "${DOTFILES_LOCATION}/.vim" "$HOME/.vim"
ln -s "${DOTFILES_LOCATION}/.vimrc" "$HOME/.vimrc"
ln -s "${DOTFILES_LOCATION}/.tmux.conf" "$HOME/.tmux.conf"
ln -s "${DOTFILES_LOCATION}/.gitconfig" "$HOME/.gitconfig"
# Run bash- or zsh specific init scripts
$SHELL_CHOICE "$DOTFILES_LOCATION/shell/$SHELL_CHOICE/init"
# install the preferred macOS utilities and devtools
if [ "$(uname)" = 'Darwin' ]; then
if ! command -v brew > /dev/null 2>&1; then
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
eval "$(/opt/homebrew/bin/brew shellenv $SHELL_CHOICE)"
fi
brew install \
ansible \
asdf \
bash-completion \
fzf \
git \
go \
htop \
imagemagick \
jq \
kind \
kubernetes-cli \
maven \
nmap \
openssl \
p7zip \
rename \
shellcheck \
the_silver_searcher \
tmux \
tree \
vim \
watch
brew install --cask \
boom-3d \
brave-browser \
claude \
claude-code \
calibre \
font-fira-code \
imazing \
iterm2 \
vlc \
visual-studio-code
brew tap beeftornado/rmtree
# python
asdf plugin-add python
asdf install python latest:3
# node
asdf plugin add nodejs https://github.com/asdf-vm/asdf-nodejs.git
asdf install nodejs latest
asdf global nodejs latest
# ruby
asdf plugin add ruby https://github.com/asdf-vm/asdf-ruby.git
asdf install ruby latest
fi