PortValhalla/scripts/Common/Scripts/software.fish

43 lines
1 KiB
Fish
Raw Normal View History

#!/bin/env fish
begin
set -l dir (status dirname)
function installSW
end
function configureSW
end
function userConfig -a user
end
function runInstaller -V dir -a action
if [ -z "$action" ] || [ "$action" = "install" ]
2024-07-15 11:56:27 +00:00
installSW $argv[2..]
2024-07-14 08:10:04 +00:00
else if [ "$action" = "configure" ]
configureSW $argv[2..]
source "$dir/config.fish"
set -l users (getUsers)
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" = "userConfig" ]
set -l name $argv[2]
if [ -z "$name" ]
set name "$USER"
end
userConfig "$name" $argv[3..]
end
end
end