feat: make efibootmgr and sbsign optional dependencies

main
Adrian Wannenmacher 1 year ago
parent c4dc5fdc0a
commit 16c3dc6b66
Signed by: tfld
GPG Key ID: 19D986ECB1E492D5
  1. 16
      src/snap-pac-uki.fish

@ -7,10 +7,8 @@ end
function check_deps -d "checks if all dependencies are available"
set -l dependencies \
"efibootmgr" \
"jq" \
"rg" \
"sbsign" \
"sed" \
"snapper" \
@ -21,6 +19,18 @@ function check_deps -d "checks if all dependencies are available"
error "missing depenency: $dep"
end
end
which "efibootmgr" >/dev/null 2>/dev/null
if test $status != "0" -a $CFG_EFI = "yes"
set -g CFG_EFI "no"
echo "CFG_EFI overwriten to \"no\": 'efibootmgr' not available"
end
which "sbsign" >/dev/null 2>/dev/null
if test $status != "0" -a $CFG_EFI = "yes"
set -g CFG_SECUREBOOT "no"
echo "CFG_SECUREBOOT overwriten to \"no\": 'sbsign' not available"
end
end
function find_tasks -d "finds out what the program needs to do"
@ -122,9 +132,9 @@ end
function main
# prepare for execution
check_deps
source "/etc/snap-pac-uki/config.fish"
config
check_deps
switch $argv[1]
case "snapshots"

Loading…
Cancel
Save