-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.sh
More file actions
executable file
·47 lines (41 loc) · 946 Bytes
/
Copy pathinit.sh
File metadata and controls
executable file
·47 lines (41 loc) · 946 Bytes
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
#!/bin/bash
# exit on error
set -e
check_command() {
if ! command -v "$1" &> /dev/null; then
echo "$1 not found, installing..."
return 1
else
echo "$1 already installed"
return 0
fi
}
# check if pacman exists
is_arch() {
command -v pacman &> /dev/null
}
# install yay if on arch and not present
if is_arch; then
if ! check_command yay; then
# clean up existing directory if exists
[ -d "/tmp/yay" ] && rm -rf /tmp/yay
git clone https://aur.archlinux.org/yay.git /tmp/yay
cd /tmp/yay
yes | makepkg -si
rm -rf /tmp/yay
fi
fi
# install mise if not present
if ! check_command mise; then
if is_arch; then
yay -Sy --needed --noconfirm mise
else
curl https://mise.run | sh
fi
# TODO: fix activate for bash/zsh
~/.local/bin/mise activate --shims
fi
if [ -n "${WEB_HOST}" ]; then
echo "WEB_HOST is set. running workstation setup..."
task -d ~/dotfiles install:workstation
fi