-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup_extras
executable file
·54 lines (45 loc) · 1.44 KB
/
setup_extras
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
#!/usr/bin/env bash
command_exists?() {
command -v "$1" 2>&1 1>/dev/null
}
if [ ! -d "$HOME/.nano/nanorc" ]; then
echo "installing nanorc..."
git clone https://github.com/scopatz/nanorc.git "$HOME/.nano/nanorc"
else
echo "skipping nanorc: already installed"
fi
if [ ! -d "$HOME/.tfenv" ]; then
echo "installing tfenv..."
git clone https://github.com/tfutils/tfenv.git "$HOME/.tfenv"
else
echo "skipping tfenv: already installed"
fi
if ! command_exists? "rg"; then
ripgrep_version="12.0.1"
ripgrep_deb="$HOME/ripgrep.deb"
echo "installing ripgrep ${ripgrep_version}..."
curl -L "https:/github.com/BurntSushi/ripgrep/releases/download/${ripgrep_version}/ripgrep_${ripgrep_version}_amd64.deb" -o "$ripgrep_deb"
if [ -f "$ripgrep_deb" ]; then
sudo dpkg -i "$ripgrep_deb"
rm -f "$ripgrep_deb"
else
echo "failed to download ripgrep - see above for reason"
fi
else
echo "skipping ripgreg: already installed"
fi
# only install wsl related extras if wslpath exists
if ! command_exists? "wslpath"; then
echo "skiping wsl extras: no wslpath"
else
weasel_c_path=$(wslpath 'C:\weasel-pageant')
if [ ! -d "$weasel_c_path" ]; then
weasel_zipname="weasel-pageant-1.4"
wget "https://github.com/vuori/weasel-pageant/releases/download/v1.4/$weasel_zipname.zip"
unzip "$weasel_zipname"
mv "$weasel_zipname" "$weasel_c_path"
rm "$weasel_zipname.zip"
else
echo "skipping weasel-pageant: already exists"
fi
fi