-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeps
executable file
·91 lines (82 loc) · 2.51 KB
/
deps
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
# Things I like to have
PACKAGES="git fish tmux stow neofetch sccache"
# Stuff that other tools need to build
PACKAGES+=" curl wget pkg-config unzip make"
# Other things
PACKAGES+=" npm gcc"
PIP_PACKAGES="virtualenv"
CRATES="aichat bat du-dust eza gitui ripgrep cargo-update bob-nvim zellij tealdeer fd-find skim"
echo
echo "Packages to install: $PACKAGES"
read -rp "?Install apt/brew/yum packages? (y/n)? " choice
if [[ $choice =~ ^[Yy]$ ]]; then
if command -v brew >/dev/null 2>&1; then
brew update
brew upgrade
brew install $PACKAGES
elif command -v apt >/dev/null 2>&1; then
sudo apt update
sudo apt upgrade -y
sudo apt install -y "$PACKAGES"
elif command -v yum >/dev/null 2>&1; then
sudo yum update
sudo yum upgrade -y
sudo yum install -y "$PACKAGES"
else
echo "No supported package manager found"
fi
fi
# Rust installation - from https://rustup.rs/
echo
if command -v cargo >/dev/null 2>&1; then
echo "Crates to install: $CRATES"
read -rp "?Install cargo crates? (y/n)? " choice
if [[ $choice =~ ^[Yy]$ ]]; then
read -rp " ?Install using cargo-binstall? (y/n)? " choice
if [[ $choice =~ ^[Yy]$ ]]; then
cargo install cargo-binstall
cargo binstall --no-confirm "$CRATES"
fi
read -rp " ?Install using sccache? (y/n)? " choice
if [[ $choice =~ ^[Yy]$ ]]; then
SCCACHE=$(which sccache)
for crate in $CRATES; do
RUSTC_WRAPPER=$SCCACHE cargo install $crate
done
fi
fi
else
read -rp "?Install rustup? (y/n)? " choice
if [[ $choice =~ ^[Yy]$ ]]; then
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
echo "You will need to restart your shell then run this script again to install Cargo crates..."
fi
fi
echo
if command -v python3 >/dev/null 2>&1; then
echo "Pip packages to install: $PIP_PACKAGES"
read -rp "?Install Pip packages? (y/n)? " choice
if [[ $choice =~ ^[Yy]$ ]]; then
python3 -m pip install $PIP_PACKAGES
fi
else
echo "Python3 not found, can't install pip packages"
fi
# Neovim from apt is out of date, bob can pull the latest versions
echo
read -rp "?Install neovim using bob? (y/n)? " choice
if [[ $choice =~ ^[Yy]$ ]]; then
bob use stable
fi
echo
if [[ $SHELL != */fish ]]; then
read -rp "?Set fish as default shell (y/n)? " choice
if [[ $choice =~ ^[Yy]$ ]]; then
chsh -s "$(command -v fish)"
echo "You may need a terminal/system reboot for this change to stick."
fi
else
echo "fish is already default, nothing to do here..."
fi
echo "Done!"