Simplify the creation of hooks
This commit is contained in:
parent
2de0d9a565
commit
d4fa8f2ebd
|
@ -2,6 +2,7 @@
|
|||
begin
|
||||
set -l dir (status dirname)
|
||||
. "$dir/../../Common/Scripts/config.fish"
|
||||
. "$dir/../../Common/Scripts/hooks.fish"
|
||||
|
||||
set -q CONFIG_MODULE || set -l CONFIG_MODULE "$dir/config.nix"
|
||||
set -q ARCH_TIMEZONE || set -l ARCH_TIMEZONE "Europe/Zurich"
|
||||
|
@ -37,12 +38,7 @@ begin
|
|||
man-pages \
|
||||
texinfo
|
||||
|
||||
and if type -q installDrivers
|
||||
echo "Installing drivers…"
|
||||
installDrivers
|
||||
else
|
||||
true
|
||||
end
|
||||
and runHook installDrivers "Installing drivers…" || true
|
||||
|
||||
and "$dir/../../copy-repo.fish" "$ARCH_MOUNT_ROOT$tempRoot"
|
||||
and genfstab -U "$ARCH_MOUNT_ROOT" >> "$ARCH_MOUNT_ROOT/etc/fstab"
|
||||
|
|
12
scripts/Common/Scripts/hooks.fish
Normal file
12
scripts/Common/Scripts/hooks.fish
Normal file
|
@ -0,0 +1,12 @@
|
|||
function runHook -S -a name message
|
||||
if type -q "$name"
|
||||
if test -n "$message"
|
||||
echo "$message"
|
||||
end
|
||||
|
||||
"$name"
|
||||
or exit
|
||||
else
|
||||
return 1
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue