Refactor the software install workflow

This commit is contained in:
Manuel Thalmann 2024-09-13 14:47:07 +02:00
commit a7be9fa736
25 changed files with 41 additions and 57 deletions
scripts/Common/Scripts

View file

@ -12,23 +12,17 @@ begin
end
function runInstaller -V dir -a action
source "$dir/config.fish"
if [ -z "$action" ] || [ "$action" = "install" ]
installSW $argv[2..]
else if [ "$action" = "configure" ]
configureSW $argv[2..]
source "$dir/config.fish"
set -l users (getUsers)
runInstaller "configure"
if not isConfigured || [ "$USER" != (getConfig "valhalla.setupUser.name") ]
runInstaller userConfig
end
for name in (echo "$users" | jq '.[]' --raw-output0 | string split0)
if [ "$name" != "$USER" ]
runInstaller userConfig "$name"
end
end
else if [ "$action" = "configure" ]
configureSW $argv[2..]
else if [ "$action" = "userConfig" ]
set -l name $argv[2]