Create a script for running hooks
This commit is contained in:
parent
17a4af37d8
commit
bb9f94a354
2 changed files with 15 additions and 13 deletions
|
@ -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
14
scripts/Common/Scripts/hooks.sh
Executable file
|
@ -0,0 +1,14 @@
|
|||
#!/bin/bash
|
||||
|
||||
function runHook() {
|
||||
function fallback() {
|
||||
${@:2};
|
||||
}
|
||||
|
||||
if command -v $1 > /dev/null
|
||||
then
|
||||
$1 fallback;
|
||||
else
|
||||
fallback;
|
||||
fi;
|
||||
}
|
Loading…
Reference in a new issue