]> git.r.bdr.sh - rbdr/dotfiles/blobdiff - provision
Restore window borders
[rbdr/dotfiles] / provision
index 1580c24b7a47aa9315b4bd92d7de0c42ed6ffef5..6574db986eee7de0614fd9c48155359a2fc3acc2 100755 (executable)
--- a/provision
+++ b/provision
@@ -1,22 +1,34 @@
-#!/usr/bin/env sh
+#!/usr/bin/env bash
 
 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"
 
 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"
+    install_command="install"
   else
   else
-    if command -v apt &>  /dev/null; then
-      command_name="brew"
+    if command -v dnf &>  /dev/null; then
+      command_name="dnf"
+      install_command="install"
     else
     else
-      echo "Error: No valid package manager. Make sure brew or apt are available."
-      exit 1
+      if command -v pacman &>  /dev/null; then
+        command_name="pacman"
+        install_command="-Sy"
+      else
+        if command -v pacman &>  /dev/null; then
+          command_name="apt"
+          install_command="install"
+        else
+          echo "Error: No valid package manager. Make sure brew or apt are available."
+          exit 1
+        fi
+      fi
     fi
   fi
   file="./provisioning/${command_name}_$1"
   if [[ -f $file ]]; then
     echo "Provisioning $1 with $command_name"
     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
+    cat ./provisioning/${command_name}_$1 | xargs ${command_name} ${install_command}
   else
     echo "No provisioning recipe for $1 with $command_name"
     exit 1
   else
     echo "No provisioning recipe for $1 with $command_name"
     exit 1