30 lines
894 B
Fish
Executable file
30 lines
894 B
Fish
Executable file
#!/bin/env fish
|
|
begin
|
|
set -l dir (status dirname)
|
|
source "$dir/../../../lib/software.fish"
|
|
|
|
function configureSW -V dir
|
|
sudo systemctl enable --now docker
|
|
end
|
|
|
|
function userConfig
|
|
argparse -i "user=" -- $argv
|
|
sudo usermod -aG docker "$_flag_user"
|
|
end
|
|
|
|
function installSWDependencies -V dir -V args
|
|
source "$dir/../../../lib/settings.fish"
|
|
set -la argv $args
|
|
argparse -i "name=" "user=" -- $argv
|
|
set -l services (getProgramConfig --name "$_flag_name" --json | jq '.services')
|
|
|
|
for service in (echo "$services" | jq '. // {} | keys[]' --raw-output0 | string split0 || true)
|
|
|
|
if echo "$services" | SERVICE=$service jq --exit-status ".[env.SERVICE].enable" >/dev/null
|
|
fish "$dir/services/$service/main.fish" $argv
|
|
end
|
|
end
|
|
end
|
|
|
|
runInstaller $argv
|
|
end
|