Add a function for declaring software dependencies

This commit is contained in:
Manuel Thalmann 2024-11-05 17:45:13 +01:00
parent 15f58e4daa
commit ee858778f4
2 changed files with 20 additions and 2 deletions

View file

@ -21,6 +21,9 @@ begin
sudo systemctl enable --global surface-dtx-userd.service
end
function installSWDependencies
fish "$dir/../Surface/main.fish" $argv
end
runInstaller --force $argv
fish "$dir/../Surface/main.fish" $argv
end

View file

@ -9,7 +9,8 @@ begin
set -l actions \
install installSW \
configure configureSW \
userConfig userConfig
userConfig userConfig \
dependencies installSWDependencies
set -a actions $backupActions
@ -109,6 +110,8 @@ begin
set -l name $_flag_name
set -l action $_flag_action
set -l args $_flag_force --name "$name"
set -l dependencyFunction "installSWDependencies"
set -l installDependencies
source "$dir/settings.fish"
if [ -n "$_flag_force" ]
@ -117,6 +120,12 @@ begin
set force false
end
if functions -q "$dependencyFunction"
set installDependencies __runSosftwareDependencyInstaller
functions -c "$dependencyFunction" "$installDependencies"
functions -e "$dependencyFunction"
end
if isProgramEnabled $args || $force
set install true
else
@ -204,5 +213,11 @@ begin
end
end
end
if [ -n "$installDependencies" ]
"$installDependencies" --action "$action" $args $argv
functions -c "$installDependencies" "$dependencyFunction"
functions -e "$installDependencies"
end
end
end