-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup
More file actions
executable file
·152 lines (121 loc) · 3.55 KB
/
setup
File metadata and controls
executable file
·152 lines (121 loc) · 3.55 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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
#!/usr/bin/env bash
DIRNAME=$(dirname $0)
DEPENDENCIES=('git' 'curl' 'zsh' 'tmux' 'vim' 'neovim' 'emacs' 'tree', 'ripgrep', 'ghostty' 'neovim', 'direnv' 'gh')
[ $(uname -s) = 'Darwin' ] && IS_MAC=1 || IS_MAC=0
if [ $IS_MAC = 1 ]; then
PACKAGE_MGR='brew'
DEPENDENCIES+=('reattach-to-user-namespace' 'the_silver_searcher' 'zsh-completions' 'gnupg2' 'bat' 'eza' 'k9s' 'jq' 'atuin' 'zoxide')
cat $DIRNAME/.aliases/osx $DIRNAME/.aliases/shared >$HOME/.aliases
else
PACKAGE_MGR='sudo apt-get -y'
# Requires Ubuntu > 13.10
DEPENDENCIES+=('silversearcher-ag')
cat $DIRNAME/.aliases/linux $DIRNAME/.aliases/shared >$HOME/.aliases
fi
echo -e "\033[0;34mInstalling dependencies...\033[0m"
function check_dependency {
if [ $IS_MAC = 1 ]; then
brew list $1 >>/dev/null 2>&1
test $? -eq 0
else
sudo dpkg-query -L $1 >>/dev/null 2>&1
fi
}
function install_dependency {
echo -e "\033[0;34mInstalling $1...\033[0m"
check_dependency $1 || $PACKAGE_MGR install $1
}
for dependency in ${DEPENDENCIES[@]}; do
install_dependency $dependency
done
echo -e "\033[0;34mSetting up Vundle...\033[0m"
if [ -d $HOME/.vim/bundle/Vundle.vim ]; then
(
cd $HOME/.vim/bundle/Vundle.vim
git pull -q
)
else
git clone https://github.com/gmarik/Vundle.vim.git $HOME/.vim/bundle/Vundle.vim
fi
(
cd $HOME
vim +PluginInstall +qall
)
echo -e "\033[0;34mSetting up fzf...\033[0m"
mkdir -p $HOME/.shadowboxes $HOME/bin $HOME/man
if [ -d $HOME/.shadowboxes/fzf ]; then
(
cd $HOME/.shadowboxes/fzf
git pull -q
)
else
git clone https://github.com/junegunn/fzf.git $HOME/.shadowboxes/fzf
fi
echo -e "\033[0;34mSetting up termbin...\033[0m"
if [ ! -f $HOME/bin/termbin ]; then
nc termbin.com 9999 >$HOME/bin/
chmod +x $HOME/bin/termbin
fi
echo -e "\033[0;34mSetting up mise...\033[0m"
if ! command -v mise &>/dev/null; then
if [ $IS_MAC = 1 ]; then
brew install mise
else
curl https://mise.run | sh
fi
eval "$(mise activate bash)"
else
echo "mise is already installed"
fi
echo -e "\033[0;34mInstalling languages with mise...\033[0m"
mise use --global node@latest
mise use --global python@latest
mise use --global ruby@latest
mise use --global go@latest
echo -e "\033[0;34mSetting up Claude Code...\033[0m"
if ! command -v claude &>/dev/null; then
curl -fsSL https://claude.ai/install.sh | bash
else
echo "Claude Code is already installed"
fi
echo -e "\033[0;34mSetting up Codex CLI...\033[0m"
if ! command -v codex &>/dev/null; then
if command -v npm &>/dev/null; then
npm install -g @openai/codex
elif command -v mise &>/dev/null; then
mise x node@latest -- npm install -g @openai/codex
else
echo "npm is not available; skipping Codex CLI install"
fi
else
echo "Codex CLI is already installed"
fi
rsync --exclude ".git/" \
--exclude ".DS_Store" \
--exclude ".aliases" \
--exclude ".fonts" \
--exclude "README.md" \
--exclude "TROUBLESHOOTING.md" \
--exclude "Dockerfile" \
--exclude "images" \
--exclude "install" \
--exclude "setup" \
--exclude "vm" \
-av --no-perms -q "$(dirname $0)/" $HOME
$HOME/.shadowboxes/fzf/install --all
if [ $IS_MAC = 1 ]; then
echo -e "\033[0;34mSetting up fonts...\033[0m"
cp .fonts/*.otf /Library/Fonts/
CASKS=('1password' 'alfred' 'divvy' 'docker' 'google-chrome' 'licecap' 'spotify' 'superhuman' 'visual-studio-code')
function check_cask {
brew list $1 >>/dev/null 2>&1
test $? -eq 0
}
function install_cask {
echo -e "\033[0;34mInstalling $1...\033[0m"
check_cask $1 || brew install $1
}
for cask in ${CASKS[@]}; do
install_cask $cask
done
fi