Create a script for running hooks

This commit is contained in:
Manuel Thalmann 2024-03-23 17:23:45 +01:00
parent e81291af6b
commit ab29a2e3f4
2 changed files with 15 additions and 13 deletions

View file

@ -5,22 +5,10 @@ pushd "$rootDir" > /dev/null;
. "../Software/base-devel/install.sh";
. "../Config/pacman/install.sh";
. "../Software/yay/install.sh";
. "../../Common/Scripts/hooks.sh";
sudo pacman --noconfirm -Syu pacman-contrib;
function runHook() {
function fallback() {
${@:2};
}
if command -v $1 > /dev/null
then
$1 fallback;
else
fallback;
fi;
}
runHook installDrivers;
runHook installSoftware \

14
scripts/Common/Scripts/hooks.sh Executable file
View file

@ -0,0 +1,14 @@
#!/bin/bash
function runHook() {
function fallback() {
${@:2};
}
if command -v $1 > /dev/null
then
$1 fallback;
else
fallback;
fi;
}