2024-09-20 05:25:03 +00:00
|
|
|
#!/bin/env fish
|
|
|
|
begin
|
|
|
|
set -l dir (status dirname)
|
2024-11-01 12:12:16 +00:00
|
|
|
source "$dir/../../../lib/software.fish"
|
2024-09-20 05:25:03 +00:00
|
|
|
|
|
|
|
function configureSW -V dir
|
|
|
|
sudo systemctl enable --now docker
|
|
|
|
end
|
|
|
|
|
2024-11-02 17:14:54 +00:00
|
|
|
function userConfig
|
|
|
|
argparse -i "user=" -- $argv
|
|
|
|
sudo usermod -aG docker "$_flag_user"
|
2024-09-20 05:25:03 +00:00
|
|
|
end
|
|
|
|
|
2024-11-22 16:31:08 +00:00
|
|
|
function installSWDependencies -V dir -V args
|
|
|
|
source "$dir/../../../lib/settings.fish"
|
|
|
|
set -la argv $args
|
|
|
|
argparse -i "name=" "user=" -- $argv
|
2024-11-25 18:11:14 +00:00
|
|
|
set -l services (getProgramConfig --name "$_flag_name" --json | jq '.services')
|
2024-11-22 16:31:08 +00:00
|
|
|
|
2024-12-05 15:34:24 +00:00
|
|
|
for service in (echo "$services" | jq '. // {} | keys[]' --raw-output0 | string split0 || true)
|
2024-11-22 16:31:08 +00:00
|
|
|
|
|
|
|
if echo "$services" | SERVICE=$service jq --exit-status ".[env.SERVICE].enable" >/dev/null
|
|
|
|
fish "$dir/services/$service/main.fish" $argv
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2024-09-20 05:25:03 +00:00
|
|
|
runInstaller $argv
|
|
|
|
end
|