-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·64 lines (51 loc) · 1.31 KB
/
install.sh
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
#! /usr/bin/env bash
# Installs configuration onto a system
# Usage: ./install.sh
set -euo pipefail
mkdir -p "${HOME}/.local/bin"
mac() {
if ! command -v 'brew' &> /dev/null; then
echo 'No brew - install it: https://brew.sh/'
exit 1
fi
brew install stow
bash update_crystalline_osx.sh
defaults write com.visualstudio.code.oss ApplePressAndHoldEnabled -bool false
}
linux() {
if command -v 'yay' &> /dev/null; then
# Arch
yay -S stow crystalline
elif command -v 'apt' &> /dev/null; then
# Debian based
apt install stow
elif command -v 'apk' &> /dev/null; then
# Alpine
apk add stow
else
echo 'No recognised package managers'
exit 1
fi
}
# Check for a stow install, installs if not present
check_stow_install() {
if ! command -v 'stow' &> /dev/null; then
echo "no stow install found, attempting to install"
if [[ "$(uname -s)" -eq 'Darwin' ]]; then
mac
else
linux
fi
fi
return
}
function run_stow() {
check_stow_install
echo "running stow"
# Stow everything except install script
stow --target=${HOME} */
}
[[ ! -d "${HOME}/.asdf" ]] && git clone https://github.com/asdf-vm/asdf.git "${HOME}/.asdf"
run_stow
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source "$HOME/.cargo/env" && cargo install ripgrep bottom