]> git.r.bdr.sh - rbdr/dotfiles/blame - provision
Update deps, fix for linux
[rbdr/dotfiles] / provision
CommitLineData
cb36b00f 1#!/usr/bin/env bash
8bf2adee
RBR
2
3if [[ -z "$1" ]]; then
4 echo "Run with parameters: essential, nice, cask_essential, or cask_nice"
5else
6 if command -v brew &> /dev/null; then
7 command_name="brew"
ad7a214d 8 install_command="install"
8bf2adee 9 else
f9f05d0f
RBR
10 if command -v dnf &> /dev/null; then
11 command_name="dnf"
ad7a214d 12 install_command="install"
8bf2adee 13 else
ad7a214d
RBR
14 if command -v pacman &> /dev/null; then
15 command_name="pacman"
16 install_command="-Sy"
17 else
dd00198b
RBR
18 if command -v pacman &> /dev/null; then
19 command_name="apt"
20 install_command="install"
21 else
22 echo "Error: No valid package manager. Make sure brew or apt are available."
23 exit 1
24 fi
ad7a214d 25 fi
8bf2adee
RBR
26 fi
27 fi
28 file="./provisioning/${command_name}_$1"
29 if [[ -f $file ]]; then
30 echo "Provisioning $1 with $command_name"
ad7a214d 31 cat ./provisioning/${command_name}_$1 | xargs ${command_name} ${install_command}
8bf2adee
RBR
32 else
33 echo "No provisioning recipe for $1 with $command_name"
1c7e8bca 34 exit 1
8bf2adee
RBR
35 fi
36fi