]> git.r.bdr.sh - rbdr/dotfiles/blob - provision
60a52014ffcf0f223318dfee7ae15110604b8e5c
[rbdr/dotfiles] / provision
1 #!/usr/bin/env bash
2
3 if [[ -z "$1" ]]; then
4 echo "Run with parameters: essential, nice, cask_essential, or cask_nice"
5 else
6 if command -v brew &> /dev/null; then
7 command_name="brew"
8 else
9 if command -v apt &> /dev/null; then
10 command_name="apt"
11 else
12 echo "Error: No valid package manager. Make sure brew or apt are available."
13 exit 1
14 fi
15 fi
16 file="./provisioning/${command_name}_$1"
17 if [[ -f $file ]]; then
18 echo "Provisioning $1 with $command_name"
19 cat ./provisioning/${command_name}_$1 | xargs ${command_name} install
20 else
21 echo "No provisioning recipe for $1 with $command_name"
22 exit 1
23 fi
24 fi