This commit is contained in:
2025-07-30 15:21:10 +02:00
parent 2bc2c07114
commit 685a58aa14
48 changed files with 60 additions and 428 deletions

View File

@@ -1,6 +1,11 @@
#!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run
import freeflowuniverse.herolib.core.generator.generic as generator
import freeflowuniverse.herolib.core.pathlib
mut args := generator.GeneratorArgs{
path: '~/code/github/freeflowuniverse/herolib/lib/installers'
force: true
}
generic.scan(path:"~/code/github/freeflowuniverse/herolib/herolib/installers",force:true)!
generator.scan(args)!

View File

@@ -31,17 +31,17 @@ pub enum Cat {
}
fn args_get(path string) !GeneratorArgs {
console.print_debug('play installer code for path: ${path}')
console.print_debug('generate code for path: ${path}')
mut config_path := pathlib.get_file(path: '${path}/.heroscript', create: false)!
if !config_path.exists() {
return error("can't find path with .heroscript in ${path}")
return error("can't find path with .heroscript in ${path}, is a bug")
}
mut plbook := playbook.new(text: config_path.read()!)!
mut plbook := playbook.new(text: config_path.read()!) or { return error('failed to create playbook: ${err}') }
mut install_actions := plbook.find(filter: 'hero_code.generate_installer')!
mut install_actions := plbook.actions_find(actor:'hero_code', name: 'generate_installer')!
if install_actions.len > 0 {
for install_action in install_actions {
mut p := install_action.params
@@ -65,7 +65,7 @@ fn args_get(path string) !GeneratorArgs {
}
}
mut client_actions := plbook.find(filter: 'hero_code.generate_client')!
mut client_actions := plbook.actions_find(actor:'hero_code', name: 'generate_client')!
if client_actions.len > 0 {
for client_action in client_actions {
mut p := client_action.params

View File

@@ -26,7 +26,7 @@ pub mut:
// git_reset bool
// session &base.Session
// ```
pub fn new(args_ PlayBookNewArgs) ! {
pub fn new(args_ PlayBookNewArgs) !PlayBook {
mut args := args_
mut c := base.context() or { return error('failed to get context: ${err}') }

View File

@@ -31,7 +31,9 @@ fn args_get(args_ ArgsGet) ArgsGet {
pub fn get(args_ ArgsGet) !&CometBFT {
mut context := base.context()!
mut args := args_get(args_)
mut obj := CometBFT{}
mut obj := CometBFT{
name: args.name
}
if args.name !in cometbft_global {
if !exists(args)! {
set(obj)!
@@ -79,19 +81,7 @@ fn set_in_mem(o CometBFT) ! {
cometbft_default = o.name
}
@[params]
pub struct PlayArgs {
pub mut:
heroscript string // if filled in then plbook will be made out of it
plbook ?playbook.PlayBook
reset bool
}
pub fn play(mut plbook PlayBook) ! {
mut args := args_
mut plbook := args.plbook or { playbook.new(text: args.heroscript)! }
mut install_actions := plbook.find(filter: 'cometbft.configure')!
if install_actions.len > 0 {
for install_action in install_actions {

View File

@@ -31,7 +31,9 @@ fn args_get(args_ ArgsGet) ArgsGet {
pub fn get(args_ ArgsGet) !&MeilisearchInstaller {
mut context := base.context()!
mut args := args_get(args_)
mut obj := MeilisearchInstaller{}
mut obj := MeilisearchInstaller{
name: args.name
}
if args.name !in meilisearch_installer_global {
if !exists(args)! {
set(obj)!
@@ -79,9 +81,7 @@ fn set_in_mem(o MeilisearchInstaller) ! {
meilisearch_installer_default = o.name
}
pub fn play(mut plbook PlayBook) ! {
mut install_actions := plbook.find(filter: 'meilisearch_installer.configure')!
if install_actions.len > 0 {
for install_action in install_actions {

View File

@@ -31,7 +31,9 @@ fn args_get(args_ ArgsGet) ArgsGet {
pub fn get(args_ ArgsGet) !&Postgresql {
mut context := base.context()!
mut args := args_get(args_)
mut obj := Postgresql{}
mut obj := Postgresql{
name: args.name
}
if args.name !in postgresql_global {
if !exists(args)! {
set(obj)!
@@ -79,16 +81,7 @@ fn set_in_mem(o Postgresql) ! {
postgresql_default = o.name
}
@[params]
pub struct PlayArgs {
pub mut:
heroscript string // if filled in then plbook will be made out of it
plbook ?playbook.PlayBook
reset bool
}
pub fn play(mut plbook PlayBook) ! {
mut install_actions := plbook.find(filter: 'postgresql.configure')!
if install_actions.len > 0 {
for install_action in install_actions {

View File

@@ -31,7 +31,9 @@ fn args_get(args_ ArgsGet) ArgsGet {
pub fn get(args_ ArgsGet) !&QDrant {
mut context := base.context()!
mut args := args_get(args_)
mut obj := QDrant{}
mut obj := QDrant{
name: args.name
}
if args.name !in qdrant_installer_global {
if !exists(args)! {
set(obj)!
@@ -79,9 +81,7 @@ fn set_in_mem(o QDrant) ! {
qdrant_installer_default = o.name
}
pub fn play(mut plbook PlayBook) ! {
mut install_actions := plbook.find(filter: 'qdrant_installer.configure')!
if install_actions.len > 0 {
for install_action in install_actions {

View File

@@ -31,7 +31,9 @@ fn args_get(args_ ArgsGet) ArgsGet {
pub fn get(args_ ArgsGet) !&ZeroDB {
mut context := base.context()!
mut args := args_get(args_)
mut obj := ZeroDB{}
mut obj := ZeroDB{
name: args.name
}
if args.name !in zerodb_global {
if !exists(args)! {
set(obj)!
@@ -79,9 +81,7 @@ fn set_in_mem(o ZeroDB) ! {
zerodb_default = o.name
}
pub fn play(mut plbook PlayBook) ! {
mut install_actions := plbook.find(filter: 'zerodb.configure')!
if install_actions.len > 0 {
for install_action in install_actions {

View File

@@ -23,9 +23,7 @@ pub fn get(args_ ArgsGet) !&ZeroFS {
return &ZeroFS{}
}
pub fn play(mut plbook PlayBook) ! {
mut other_actions := plbook.find(filter: 'zerofs.')!
for other_action in other_actions {
if other_action.name in ['destroy', 'install', 'build'] {

View File

@@ -31,7 +31,9 @@ fn args_get(args_ ArgsGet) ArgsGet {
pub fn get(args_ ArgsGet) !&CoreDNS {
mut context := base.context()!
mut args := args_get(args_)
mut obj := CoreDNS{}
mut obj := CoreDNS{
name: args.name
}
if args.name !in coredns_global {
if !exists(args)! {
set(obj)!
@@ -79,9 +81,7 @@ fn set_in_mem(o CoreDNS) ! {
coredns_default = o.name
}
pub fn play(mut plbook PlayBook) ! {
mut install_actions := plbook.find(filter: 'coredns.configure')!
if install_actions.len > 0 {
for install_action in install_actions {

View File

@@ -81,10 +81,7 @@ fn set_in_mem(o DifyInstaller) ! {
dify_default = o.name
}
pub fn play(mut plbook PlayBook) ! {
mut install_actions := plbook.find(filter: 'dify.configure')!
if install_actions.len > 0 {
for install_action in install_actions {

View File

@@ -31,7 +31,9 @@ fn args_get(args_ ArgsGet) ArgsGet {
pub fn get(args_ ArgsGet) !&GiteaServer {
mut context := base.context()!
mut args := args_get(args_)
mut obj := GiteaServer{}
mut obj := GiteaServer{
name: args.name
}
if args.name !in gitea_global {
if !exists(args)! {
set(obj)!
@@ -79,9 +81,7 @@ fn set_in_mem(o GiteaServer) ! {
gitea_default = o.name
}
pub fn play(mut plbook PlayBook) ! {
mut install_actions := plbook.find(filter: 'gitea.configure')!
if install_actions.len > 0 {
for install_action in install_actions {

View File

@@ -31,7 +31,9 @@ fn args_get(args_ ArgsGet) ArgsGet {
pub fn get(args_ ArgsGet) !&LivekitServer {
mut context := base.context()!
mut args := args_get(args_)
mut obj := LivekitServer{}
mut obj := LivekitServer{
name: args.name
}
if args.name !in livekit_global {
if !exists(args)! {
set(obj)!
@@ -79,9 +81,7 @@ fn set_in_mem(o LivekitServer) ! {
livekit_default = o.name
}
pub fn play(mut plbook PlayBook) ! {
mut install_actions := plbook.find(filter: 'livekit.configure')!
if install_actions.len > 0 {
for install_action in install_actions {

View File

@@ -22,19 +22,7 @@ pub fn get(args_ ArgsGet) !&Screen {
return &Screen{}
}
@[params]
pub struct PlayArgs {
pub mut:
heroscript string // if filled in then plbook will be made out of it
plbook ?playbook.PlayBook
reset bool
}
pub fn play(mut plbook PlayBook) ! {
mut args := args_
mut plbook := args.plbook or { playbook.new(text: args.heroscript)! }
mut other_actions := plbook.find(filter: 'screen.')!
for other_action in other_actions {
if other_action.name in ['destroy', 'install', 'build'] {

View File

@@ -23,19 +23,7 @@ pub fn get(args_ ArgsGet) !&ZinitInstaller {
return &ZinitInstaller{}
}
@[params]
pub struct PlayArgs {
pub mut:
heroscript string // if filled in then plbook will be made out of it
plbook ?playbook.PlayBook
reset bool
}
pub fn play(mut plbook PlayBook) ! {
mut args := args_
mut plbook := args.plbook or { playbook.new(text: args.heroscript)! }
mut other_actions := plbook.find(filter: 'zinit_installer.')!
for other_action in other_actions {
if other_action.name in ['destroy', 'install', 'build'] {

View File

@@ -22,19 +22,7 @@ pub fn get(args_ ArgsGet) !&GolangInstaller {
return &GolangInstaller{}
}
@[params]
pub struct PlayArgs {
pub mut:
heroscript string // if filled in then plbook will be made out of it
plbook ?playbook.PlayBook
reset bool
}
pub fn play(mut plbook PlayBook) ! {
mut args := args_
mut plbook := args.plbook or { playbook.new(text: args.heroscript)! }
mut other_actions := plbook.find(filter: 'golang.')!
for other_action in other_actions {
if other_action.name in ['destroy', 'install', 'build'] {

View File

@@ -22,19 +22,7 @@ pub fn get(args_ ArgsGet) !&NodeJS {
return &NodeJS{}
}
@[params]
pub struct PlayArgs {
pub mut:
heroscript string // if filled in then plbook will be made out of it
plbook ?playbook.PlayBook
reset bool
}
pub fn play(mut plbook PlayBook) ! {
mut args := args_
mut plbook := args.plbook or { playbook.new(text: args.heroscript)! }
mut other_actions := plbook.find(filter: 'nodejs.')!
for other_action in other_actions {
if other_action.name in ['destroy', 'install', 'build'] {

View File

@@ -22,19 +22,7 @@ pub fn get(args_ ArgsGet) !&Python {
return &Python{}
}
@[params]
pub struct PlayArgs {
pub mut:
heroscript string // if filled in then plbook will be made out of it
plbook ?playbook.PlayBook
reset bool
}
pub fn play(mut plbook PlayBook) ! {
mut args := args_
mut plbook := args.plbook or { playbook.new(text: args.heroscript)! }
mut other_actions := plbook.find(filter: 'python.')!
for other_action in other_actions {
if other_action.name in ['destroy', 'install', 'build'] {

View File

@@ -22,19 +22,7 @@ pub fn get(args_ ArgsGet) !&RustInstaller {
return &RustInstaller{}
}
@[params]
pub struct PlayArgs {
pub mut:
heroscript string // if filled in then plbook will be made out of it
plbook ?playbook.PlayBook
reset bool
}
pub fn play(mut plbook PlayBook) ! {
mut args := args_
mut plbook := args.plbook or { playbook.new(text: args.heroscript)! }
mut other_actions := plbook.find(filter: 'rust.')!
for other_action in other_actions {
if other_action.name in ['destroy', 'install', 'build'] {

View File

@@ -31,7 +31,9 @@ fn args_get(args_ ArgsGet) ArgsGet {
pub fn get(args_ ArgsGet) !&MyceliumInstaller {
mut context := base.context()!
mut args := args_get(args_)
mut obj := MyceliumInstaller{}
mut obj := MyceliumInstaller{
name: args.name
}
if args.name !in mycelium_installer_global {
if !exists(args)! {
set(obj)!
@@ -79,19 +81,7 @@ fn set_in_mem(o MyceliumInstaller) ! {
mycelium_installer_default = o.name
}
@[params]
pub struct PlayArgs {
pub mut:
heroscript string // if filled in then plbook will be made out of it
plbook ?playbook.PlayBook
reset bool
}
pub fn play(mut plbook PlayBook) ! {
mut args := args_
mut plbook := args.plbook or { playbook.new(text: args.heroscript)! }
mut install_actions := plbook.find(filter: 'mycelium_installer.configure')!
if install_actions.len > 0 {
for install_action in install_actions {

View File

@@ -22,19 +22,7 @@ pub fn get(args_ ArgsGet) !&WireGuard {
return &WireGuard{}
}
@[params]
pub struct PlayArgs {
pub mut:
heroscript string // if filled in then plbook will be made out of it
plbook ?playbook.PlayBook
reset bool
}
pub fn play(mut plbook PlayBook) ! {
mut args := args_
mut plbook := args.plbook or { playbook.new(text: args.heroscript)! }
mut other_actions := plbook.find(filter: 'wireguard_installer.')!
for other_action in other_actions {
if other_action.name in ['destroy', 'install', 'build'] {

View File

@@ -23,19 +23,7 @@ pub fn get(args_ ArgsGet) !&YggdrasilInstaller {
return &YggdrasilInstaller{}
}
@[params]
pub struct PlayArgs {
pub mut:
heroscript string // if filled in then plbook will be made out of it
plbook ?playbook.PlayBook
reset bool
}
pub fn play(mut plbook PlayBook) ! {
mut args := args_
mut plbook := args.plbook or { playbook.new(text: args.heroscript)! }
mut other_actions := plbook.find(filter: 'yggdrasil.')!
for other_action in other_actions {
if other_action.name in ['destroy', 'install', 'build'] {

View File

@@ -23,19 +23,7 @@ pub fn get(args_ ArgsGet) !&ActRunner {
return &ActRunner{}
}
@[params]
pub struct PlayArgs {
pub mut:
heroscript string // if filled in then plbook will be made out of it
plbook ?playbook.PlayBook
reset bool
}
pub fn play(mut plbook PlayBook) ! {
mut args := args_
mut plbook := args.plbook or { playbook.new(text: args.heroscript)! }
mut other_actions := plbook.find(filter: 'actrunner.')!
for other_action in other_actions {
if other_action.name in ['destroy', 'install', 'build'] {

View File

@@ -22,19 +22,7 @@ pub fn get(args_ ArgsGet) !&BackBase {
return &BackBase{}
}
@[params]
pub struct PlayArgs {
pub mut:
heroscript string // if filled in then plbook will be made out of it
plbook ?playbook.PlayBook
reset bool
}
pub fn play(mut plbook PlayBook) ! {
mut args := args_
mut plbook := args.plbook or { playbook.new(text: args.heroscript)! }
mut other_actions := plbook.find(filter: 'b2.')!
for other_action in other_actions {
if other_action.name in ['destroy', 'install', 'build'] {

View File

@@ -31,7 +31,9 @@ fn args_get(args_ ArgsGet) ArgsGet {
pub fn get(args_ ArgsGet) !&DaguInstaller {
mut context := base.context()!
mut args := args_get(args_)
mut obj := DaguInstaller{}
mut obj := DaguInstaller{
name: args.name
}
if args.name !in daguserver_global {
if !exists(args)! {
set(obj)!
@@ -79,19 +81,7 @@ fn set_in_mem(o DaguInstaller) ! {
daguserver_default = o.name
}
@[params]
pub struct PlayArgs {
pub mut:
heroscript string // if filled in then plbook will be made out of it
plbook ?playbook.PlayBook
reset bool
}
pub fn play(mut plbook PlayBook) ! {
mut args := args_
mut plbook := args.plbook or { playbook.new(text: args.heroscript)! }
mut install_actions := plbook.find(filter: 'daguserver.configure')!
if install_actions.len > 0 {
for install_action in install_actions {

View File

@@ -24,10 +24,6 @@ pub fn get(args_ ArgsGet) !&FungiStor {
}
pub fn play(mut plbook PlayBook) ! {
mut args := args_
mut plbook := args.plbook or { playbook.new(text: args.heroscript)! }
mut other_actions := plbook.find(filter: 'fungistor.')!
for other_action in other_actions {
if other_action.name in ['destroy', 'install', 'build'] {

View File

@@ -31,7 +31,9 @@ fn args_get(args_ ArgsGet) ArgsGet {
pub fn get(args_ ArgsGet) !&GarageS3 {
mut context := base.context()!
mut args := args_get(args_)
mut obj := GarageS3{}
mut obj := GarageS3{
name: args.name
}
if args.name !in garage_s3_global {
if !exists(args)! {
set(obj)!
@@ -79,19 +81,7 @@ fn set_in_mem(o GarageS3) ! {
garage_s3_default = o.name
}
@[params]
pub struct PlayArgs {
pub mut:
heroscript string // if filled in then plbook will be made out of it
plbook ?playbook.PlayBook
reset bool
}
pub fn play(mut plbook PlayBook) ! {
mut args := args_
mut plbook := args.plbook or { playbook.new(text: args.heroscript)! }
mut install_actions := plbook.find(filter: 'garage_s3.configure')!
if install_actions.len > 0 {
for install_action in install_actions {

View File

@@ -23,19 +23,7 @@ pub fn get(args_ ArgsGet) !&Grafana {
return &Grafana{}
}
@[params]
pub struct PlayArgs {
pub mut:
heroscript string // if filled in then plbook will be made out of it
plbook ?playbook.PlayBook
reset bool
}
pub fn play(mut plbook PlayBook) ! {
mut args := args_
mut plbook := args.plbook or { playbook.new(text: args.heroscript)! }
mut other_actions := plbook.find(filter: 'grafana.')!
for other_action in other_actions {
if other_action.name in ['destroy', 'install', 'build'] {

View File

@@ -23,19 +23,7 @@ pub fn get(args_ ArgsGet) !&Prometheus {
return &Prometheus{}
}
@[params]
pub struct PlayArgs {
pub mut:
heroscript string // if filled in then plbook will be made out of it
plbook ?playbook.PlayBook
reset bool
}
pub fn play(mut plbook PlayBook) ! {
mut args := args_
mut plbook := args.plbook or { playbook.new(text: args.heroscript)! }
mut other_actions := plbook.find(filter: 'prometheus.')!
for other_action in other_actions {
if other_action.name in ['destroy', 'install', 'build'] {

View File

@@ -30,7 +30,9 @@ fn args_get(args_ ArgsGet) ArgsGet {
pub fn get(args_ ArgsGet) !&RClone {
mut context := base.context()!
mut args := args_get(args_)
mut obj := RClone{}
mut obj := RClone{
name: args.name
}
if args.name !in rclone_global {
if !exists(args)! {
set(obj)!
@@ -78,19 +80,7 @@ fn set_in_mem(o RClone) ! {
rclone_default = o.name
}
@[params]
pub struct PlayArgs {
pub mut:
heroscript string // if filled in then plbook will be made out of it
plbook ?playbook.PlayBook
reset bool
}
pub fn play(mut plbook PlayBook) ! {
mut args := args_
mut plbook := args.plbook or { playbook.new(text: args.heroscript)! }
mut install_actions := plbook.find(filter: 'rclone.configure')!
if install_actions.len > 0 {
for install_action in install_actions {

View File

@@ -23,19 +23,7 @@ pub fn get(args_ ArgsGet) !&Restic {
return &Restic{}
}
@[params]
pub struct PlayArgs {
pub mut:
heroscript string // if filled in then plbook will be made out of it
plbook ?playbook.PlayBook
reset bool
}
pub fn play(mut plbook PlayBook) ! {
mut args := args_
mut plbook := args.plbook or { playbook.new(text: args.heroscript)! }
mut other_actions := plbook.find(filter: 'restic.')!
for other_action in other_actions {
if other_action.name in ['destroy', 'install', 'build'] {

View File

@@ -23,19 +23,7 @@ pub fn get(args_ ArgsGet) !&S3Installer {
return &S3Installer{}
}
@[params]
pub struct PlayArgs {
pub mut:
heroscript string // if filled in then plbook will be made out of it
plbook ?playbook.PlayBook
reset bool
}
pub fn play(mut plbook PlayBook) ! {
mut args := args_
mut plbook := args.plbook or { playbook.new(text: args.heroscript)! }
mut other_actions := plbook.find(filter: 's3.')!
for other_action in other_actions {
if other_action.name in ['destroy', 'install', 'build'] {

View File

@@ -22,19 +22,7 @@ pub fn get(args_ ArgsGet) !&GridDriverInstaller {
return &GridDriverInstaller{}
}
@[params]
pub struct PlayArgs {
pub mut:
heroscript string // if filled in then plbook will be made out of it
plbook ?playbook.PlayBook
reset bool
}
pub fn play(mut plbook PlayBook) ! {
mut args := args_
mut plbook := args.plbook or { playbook.new(text: args.heroscript)! }
mut other_actions := plbook.find(filter: 'griddriver.')!
for other_action in other_actions {
if other_action.name in ['destroy', 'install', 'build'] {
@@ -91,6 +79,11 @@ pub fn (mut self GridDriverInstaller) install(args InstallArgs) ! {
}
}
pub fn (mut self GridDriverInstaller) build() ! {
switch(self.name)
build()!
}
pub fn (mut self GridDriverInstaller) destroy() ! {
switch(self.name)
destroy()!

View File

@@ -22,19 +22,7 @@ pub fn get(args_ ArgsGet) !&CloudHypervisor {
return &CloudHypervisor{}
}
@[params]
pub struct PlayArgs {
pub mut:
heroscript string // if filled in then plbook will be made out of it
plbook ?playbook.PlayBook
reset bool
}
pub fn play(mut plbook PlayBook) ! {
mut args := args_
mut plbook := args.plbook or { playbook.new(text: args.heroscript)! }
mut other_actions := plbook.find(filter: 'cloudhypervisor.')!
for other_action in other_actions {
if other_action.name in ['destroy', 'install', 'build'] {

View File

@@ -23,9 +23,7 @@ pub fn get(args_ ArgsGet) !&DockerInstaller {
return &DockerInstaller{}
}
pub fn play(mut plbook PlayBook) ! {
mut other_actions := plbook.find(filter: 'docker.')!
for other_action in other_actions {
if other_action.name in ['destroy', 'install', 'build'] {

View File

@@ -22,19 +22,7 @@ pub fn get(args_ ArgsGet) !&PacmanInstaller {
return &PacmanInstaller{}
}
@[params]
pub struct PlayArgs {
pub mut:
heroscript string // if filled in then plbook will be made out of it
plbook ?playbook.PlayBook
reset bool
}
pub fn play(mut plbook PlayBook) ! {
mut args := args_
mut plbook := args.plbook or { playbook.new(text: args.heroscript)! }
mut other_actions := plbook.find(filter: 'pacman.')!
for other_action in other_actions {
if other_action.name in ['destroy', 'install', 'build'] {

View File

@@ -22,19 +22,7 @@ pub fn get(args_ ArgsGet) !&PodmanInstaller {
return &PodmanInstaller{}
}
@[params]
pub struct PlayArgs {
pub mut:
heroscript string // if filled in then plbook will be made out of it
plbook ?playbook.PlayBook
reset bool
}
pub fn play(mut plbook PlayBook) ! {
mut args := args_
mut plbook := args.plbook or { playbook.new(text: args.heroscript)! }
mut other_actions := plbook.find(filter: 'podman.')!
for other_action in other_actions {
if other_action.name in ['destroy', 'install', 'build'] {

View File

@@ -22,19 +22,7 @@ pub fn get(args_ ArgsGet) !&YoukiInstaller {
return &YoukiInstaller{}
}
@[params]
pub struct PlayArgs {
pub mut:
heroscript string // if filled in then plbook will be made out of it
plbook ?playbook.PlayBook
reset bool
}
pub fn play(mut plbook PlayBook) ! {
mut args := args_
mut plbook := args.plbook or { playbook.new(text: args.heroscript)! }
mut other_actions := plbook.find(filter: 'youki.')!
for other_action in other_actions {
if other_action.name in ['destroy', 'install', 'build'] {

View File

@@ -22,19 +22,7 @@ pub fn get(args_ ArgsGet) !&Bun {
return &Bun{}
}
@[params]
pub struct PlayArgs {
pub mut:
heroscript string // if filled in then plbook will be made out of it
plbook ?playbook.PlayBook
reset bool
}
pub fn play(mut plbook PlayBook) ! {
mut args := args_
mut plbook := args.plbook or { playbook.new(text: args.heroscript)! }
mut other_actions := plbook.find(filter: 'bun.')!
for other_action in other_actions {
if other_action.name in ['destroy', 'install', 'build'] {

View File

@@ -23,19 +23,7 @@ pub fn get(args_ ArgsGet) !&ImageMagick {
return &ImageMagick{}
}
@[params]
pub struct PlayArgs {
pub mut:
heroscript string // if filled in then plbook will be made out of it
plbook ?playbook.PlayBook
reset bool
}
pub fn play(mut plbook PlayBook) ! {
mut args := args_
mut plbook := args.plbook or { playbook.new(text: args.heroscript)! }
mut other_actions := plbook.find(filter: 'imagemagick.')!
for other_action in other_actions {
if other_action.name in ['destroy', 'install', 'build'] {

View File

@@ -23,19 +23,7 @@ pub fn get(args_ ArgsGet) !&LightHttpdInstaller {
return &LightHttpdInstaller{}
}
@[params]
pub struct PlayArgs {
pub mut:
heroscript string // if filled in then plbook will be made out of it
plbook ?playbook.PlayBook
reset bool
}
pub fn play(mut plbook PlayBook) ! {
mut args := args_
mut plbook := args.plbook or { playbook.new(text: args.heroscript)! }
mut other_actions := plbook.find(filter: 'lighttpd.')!
for other_action in other_actions {
if other_action.name in ['destroy', 'install', 'build'] {

View File

@@ -22,19 +22,7 @@ pub fn get(args_ ArgsGet) !&Tailwind {
return &Tailwind{}
}
@[params]
pub struct PlayArgs {
pub mut:
heroscript string // if filled in then plbook will be made out of it
plbook ?playbook.PlayBook
reset bool
}
pub fn play(mut plbook PlayBook) ! {
mut args := args_
mut plbook := args.plbook or { playbook.new(text: args.heroscript)! }
mut other_actions := plbook.find(filter: 'tailwind.')!
for other_action in other_actions {
if other_action.name in ['destroy', 'install', 'build'] {

View File

@@ -6,8 +6,8 @@ import freeflowuniverse.herolib.osal.startupmanager
import freeflowuniverse.herolib.osal.zinit
__global (
tailwind_global map[string]&Tailwind
tailwind_default string
tailwind4_global map[string]&Tailwind
tailwind4_default string
)
/////////FACTORY
@@ -22,19 +22,7 @@ pub fn get(args_ ArgsGet) !&Tailwind {
return &Tailwind{}
}
@[params]
pub struct PlayArgs {
pub mut:
heroscript string // if filled in then plbook will be made out of it
plbook ?playbook.PlayBook
reset bool
}
pub fn play(mut plbook PlayBook) ! {
mut args := args_
mut plbook := args.plbook or { playbook.new(text: args.heroscript)! }
mut other_actions := plbook.find(filter: 'tailwind4.')!
for other_action in other_actions {
if other_action.name in ['destroy', 'install', 'build'] {
@@ -98,7 +86,7 @@ pub fn (mut self Tailwind) destroy() ! {
// switch instance to be used for tailwind4
pub fn switch(name string) {
tailwind_default = name
tailwind4_default = name
}
// helpers

View File

@@ -31,7 +31,9 @@ fn args_get(args_ ArgsGet) ArgsGet {
pub fn get(args_ ArgsGet) !&TraefikServer {
mut context := base.context()!
mut args := args_get(args_)
mut obj := TraefikServer{}
mut obj := TraefikServer{
name: args.name
}
if args.name !in traefik_global {
if !exists(args)! {
set(obj)!
@@ -79,19 +81,7 @@ fn set_in_mem(o TraefikServer) ! {
traefik_default = o.name
}
@[params]
pub struct PlayArgs {
pub mut:
heroscript string // if filled in then plbook will be made out of it
plbook ?playbook.PlayBook
reset bool
}
pub fn play(mut plbook PlayBook) ! {
mut args := args_
mut plbook := args.plbook or { playbook.new(text: args.heroscript)! }
mut install_actions := plbook.find(filter: 'traefik.configure')!
if install_actions.len > 0 {
for install_action in install_actions {

View File

@@ -22,19 +22,7 @@ pub fn get(args_ ArgsGet) !&ZolaInstaller {
return &ZolaInstaller{}
}
@[params]
pub struct PlayArgs {
pub mut:
heroscript string // if filled in then plbook will be made out of it
plbook ?playbook.PlayBook
reset bool
}
pub fn play(mut plbook PlayBook) ! {
mut args := args_
mut plbook := args.plbook or { playbook.new(text: args.heroscript)! }
mut other_actions := plbook.find(filter: 'zola.')!
for other_action in other_actions {
if other_action.name in ['destroy', 'install', 'build'] {