-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·112 lines (97 loc) · 3.33 KB
/
install.sh
File metadata and controls
executable file
·112 lines (97 loc) · 3.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
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
#!/bin/bash
WDIR="$PWD"; [ "$PWD" = "/" ] && WDIR=""
case "$0" in
/*) SCRIPTDIR="${0}";;
*) SCRIPTDIR="$WDIR/${0#./}";;
esac
SCRIPTDIR="${SCRIPTDIR%/*}"
echo "--- Homebrew Packages ---"
if hash brew 2>/dev/null; then
echo "brew already installed."
else
echo "No brew found, installing Homebrew."
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> $HOME/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
fi
# iterm2 https://github.com/gnachman/iTerm2
/opt/homebrew/bin/brew install --cask iterm2
# add helix editor to brew
/opt/homebrew/bin/brew tap helix-editor/helix
# zig master https://github.com/ziglang/zig
/opt/homebrew/bin/brew install zig --HEAD
# git https://git-scm.com
# gitui https://github.com/Extrawurst/gitui
# go https://github.com/golang/go
# gopls https://github.com/golang/tools/tree/master/gopls
# helix https://github.com/helix-editor/helix
# neovim https://github.com/neovim/neovim
# node https://github.com/nodejs/node
# ripgrep https://github.com/BurntSushi/ripgrep
# rust-analyzer https://github.com/rust-lang/rust-analyzer
# tmux https://github.com/tmux/tmux/wiki
/opt/homebrew/bin/brew install git gitui go gopls helix neovim node ripgrep rust-analyzer tmux
# install node neovim and typescript dependencies
/opt/homebrew/bin/npm install -g neovim typescript typescript-language-server eslint prettier
# install zls
# zls https://github.com/zigtools/zls
echo "--- ZLS ---"
if hash zls 2>/dev/null; then
echo "zls already installed."
else
echo "No zls found, installing Zig Language Server."
rm -rf $HOME/zls
/opt/homebrew/bin/git clone --recurse-submodules https://github.com/zigtools/zls $HOME/zls
cd $HOME/zls
/opt/homebrew/bin/zig build -Drelease-safe
./zig-out/bin/zls config
cd $WDIR
fi
# install rust
# rust https://github.com/rust-lang/rust
echo "--- Rustup ---"
if hash rustup 2>/dev/null; then
echo "rustup already installed."
else
echo "No rustup found, installing rustup"
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
fi
echo "--- wasm-pack ---"
if hash wasm-pack 2>/dev/null; then
echo "wasm-pack already installed."
else
echo "No wasm-pack found, installing wasm-pack"
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
fi
echo "--- wgsl_analyzer ---"
if hash wgsl_analyzer 2>/dev/null; then
echo "wgsl_analyzer already installed."
else
echo "wgsl_analyzer not found, installing wgsl_analyzer"
cargo install --git https://github.com/wgsl-analyzer/wgsl-analyzer wgsl_analyzer
fi
# --- Update Config Files ---
echo "--- Config Files ---"
# Update zsh config
echo "Do you want to update zsh config? [Y/n]"
read UPDATE_ZSH
if [[ $UPDATE_ZSH =~ [^nN] ]] || [[ -z $UPDATE_ZSH ]]; then
cp $SCRIPTDIR/zsh/.zshrc $HOME/
echo "Copied $SCRIPTDIR/zsh/.zshrc to $HOME/"
fi
# Update nvim config
echo "Do you want to update nvim config? [Y/n]"
read UPDATE_NVIM
if [[ $UPDATE_NVIM =~ [^nN] ]] || [[ -z $UPDATE_NVIM ]]; then
rm -rf $HOME/.config/nvim
cp -R $SCRIPTDIR/nvim $HOME/.config/
echo "Copied $SCRIPTDIR/nvim to $HOME/.config"
fi
# Update helix config
echo "Do you want to update helix config? [Y/n]"
read UPDATE_HELIX
if [[ $UPDATE_HELIX =~ [^nN] ]] || [[ -z $UPDATE_HELIX ]]; then
rm -rf $HOME/.config/helix
cp -R $SCRIPTDIR/helix $HOME/.config/
echo "Copied $SCRIPTDIR/helix to $HOME/.config"
fi