aboutsummaryrefslogtreecommitdiff
path: root/provision
diff options
context:
space:
mode:
authorRuben Beltran del Rio <ruben@unlimited.pizza>2023-03-19 14:08:51 +0100
committerRuben Beltran del Rio <ruben@unlimited.pizza>2023-03-19 14:08:51 +0100
commit08ea1b60270d697fff5992eb9b665cec35493b6d (patch)
tree449a026547c710089360dd2b3921c6e3276cab52 /provision
parentb945717bde6231332093f4715e492c8ed7c6bd8a (diff)
parentf6b56240fff7c0ddf862c77434c2dc9fd54fd543 (diff)
Merge branch 'main' of git.sr.ht:~rbdr/dotfiles
Diffstat (limited to 'provision')
-rwxr-xr-xprovision13
1 files changed, 10 insertions, 3 deletions
diff --git a/provision b/provision
index 60a5201..baac03b 100755
--- a/provision
+++ b/provision
@@ -5,18 +5,25 @@ if [[ -z "$1" ]]; then
else
if command -v brew &> /dev/null; then
command_name="brew"
+ install_command="install"
else
if command -v apt &> /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
+ if command -v pacman &> /dev/null; then
+ command_name="pacman"
+ install_command="-Sy"
+ else
+ echo "Error: No valid package manager. Make sure brew or apt are available."
+ exit 1
+ fi
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