diff options
| author | Ruben Beltran del Rio <ruben@unlimited.pizza> | 2021-06-28 20:36:47 +0200 |
|---|---|---|
| committer | Ruben Beltran del Rio <ruben@unlimited.pizza> | 2021-06-28 20:36:47 +0200 |
| commit | 8bf2adeececb300944479c7a07ff8c6c0af9f4a5 (patch) | |
| tree | a45840e281a1e0d342cab6214e5c955d6b71f2ec /provision | |
| parent | 484003107180c171a169999e7a8eb161db509071 (diff) | |
Add provisioning command
Diffstat (limited to 'provision')
| -rwxr-xr-x | provision | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/provision b/provision new file mode 100755 index 0000000..d36cced --- /dev/null +++ b/provision @@ -0,0 +1,23 @@ +#!/usr/bin/env sh + +if [[ -z "$1" ]]; then + echo "Run with parameters: essential, nice, cask_essential, or cask_nice" +else + if command -v brew &> /dev/null; then + command_name="brew" + else + if command -v apt &> /dev/null; then + command_name="brew" + else + echo "Error: No valid package manager. Make sure brew or apt are available." + exit 1 + fi + fi + file="./provisioning/${command_name}_$1" + if [[ -f $file ]]; then + echo "Provisioning $1 with $command_name" + cat ./provisioning/${command_name}_$1 | xargs ${command_name} install + else + echo "No provisioning recipe for $1 with $command_name" + fi +fi |