2024-07-13 16:36:24 +00:00
|
|
|
#!/bin/env fish
|
|
|
|
begin
|
2024-07-20 01:50:38 +00:00
|
|
|
set -l dir (status dirname)
|
|
|
|
|
2024-07-13 16:36:24 +00:00
|
|
|
function installSW
|
|
|
|
end
|
|
|
|
|
|
|
|
function configureSW
|
|
|
|
end
|
|
|
|
|
2024-07-20 01:50:38 +00:00
|
|
|
function userConfig -a user
|
|
|
|
end
|
|
|
|
|
|
|
|
function runInstaller -V dir -a action
|
2024-09-13 12:47:07 +00:00
|
|
|
source "$dir/config.fish"
|
|
|
|
|
2024-07-13 16:36:24 +00:00
|
|
|
if [ -z "$action" ] || [ "$action" = "install" ]
|
2024-07-15 11:56:27 +00:00
|
|
|
installSW $argv[2..]
|
2024-09-13 12:47:07 +00:00
|
|
|
runInstaller "configure"
|
2024-07-20 01:50:38 +00:00
|
|
|
|
2024-07-20 12:06:25 +00:00
|
|
|
if not isConfigured || [ "$USER" != (getConfig "valhalla.setupUser.name") ]
|
|
|
|
runInstaller userConfig
|
|
|
|
end
|
2024-09-13 12:47:07 +00:00
|
|
|
else if [ "$action" = "configure" ]
|
|
|
|
configureSW $argv[2..]
|
2024-07-20 01:50:38 +00:00
|
|
|
else if [ "$action" = "userConfig" ]
|
|
|
|
set -l name $argv[2]
|
|
|
|
|
|
|
|
if [ -z "$name" ]
|
|
|
|
set name "$USER"
|
|
|
|
end
|
|
|
|
|
|
|
|
userConfig "$name" $argv[3..]
|
2024-07-13 16:36:24 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|