-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstaller.sh
More file actions
executable file
·43 lines (36 loc) · 845 Bytes
/
installer.sh
File metadata and controls
executable file
·43 lines (36 loc) · 845 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
#!/usr/bin/env sh
# Provides package manager commands for the robot DotfilesLibrary Install
# keyword.
brew() {
# homebrew will automatically skip packages that are already installed.
pkg="$1"
command brew install "$pkg"
}
nix() {
pkg="$1"
if ! nix-env --query --installed "$pkg" > /dev/null 2>&1; then
nix-env -iA nixpkgs."$pkg"
fi
}
pacman() {
pkg="$1"
if command -v sudo &> /dev/null; then
sudo pacman -S --needed --noconfirm "$pkg"
else
pacman -S --needed --noconfirm "$pkg"
fi
}
aur() {
pkg="$1"
yay --aur -S --needed --noconfirm "$pkg"
}
apt() {
# apt will automatically skip packages that are already installed.
pkg="$1"
if command -v sudo &> /dev/null; then
sudo apt install -y "$pkg"
else
apt install -y "$pkg"
fi
}
"$@"