...
This commit is contained in:
@@ -2,8 +2,8 @@ module tailwind4
|
||||
|
||||
import freeflowuniverse.herolib.core.playbook { PlayBook }
|
||||
import freeflowuniverse.herolib.ui.console
|
||||
import json
|
||||
import freeflowuniverse.herolib.osal.startupmanager
|
||||
import freeflowuniverse.herolib.osal.zinit
|
||||
|
||||
__global (
|
||||
tailwind4_global map[string]&Tailwind
|
||||
@@ -15,14 +15,25 @@ __global (
|
||||
@[params]
|
||||
pub struct ArgsGet {
|
||||
pub mut:
|
||||
name string
|
||||
name string = 'default'
|
||||
}
|
||||
|
||||
pub fn get(args_ ArgsGet) !&Tailwind {
|
||||
pub fn new(args ArgsGet) !&Tailwind {
|
||||
return &Tailwind{}
|
||||
}
|
||||
|
||||
pub fn get(args ArgsGet) !&Tailwind {
|
||||
return new(args)!
|
||||
}
|
||||
|
||||
pub fn play(mut plbook PlayBook) ! {
|
||||
if !plbook.exists(filter: 'tailwind4.') {
|
||||
return
|
||||
}
|
||||
mut install_actions := plbook.find(filter: 'tailwind4.configure')!
|
||||
if install_actions.len > 0 {
|
||||
return error("can't configure tailwind4, because no configuration allowed for this installer.")
|
||||
}
|
||||
mut other_actions := plbook.find(filter: 'tailwind4.')!
|
||||
for other_action in other_actions {
|
||||
if other_action.name in ['destroy', 'install', 'build'] {
|
||||
@@ -44,28 +55,6 @@ pub fn play(mut plbook PlayBook) ! {
|
||||
//////////////////////////# LIVE CYCLE MANAGEMENT FOR INSTALLERS ///////////////////////////////////
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
fn startupmanager_get(cat zinit.StartupManagerType) !startupmanager.StartupManager {
|
||||
// unknown
|
||||
// screen
|
||||
// zinit
|
||||
// tmux
|
||||
// systemd
|
||||
match cat {
|
||||
.zinit {
|
||||
console.print_debug('startupmanager: zinit')
|
||||
return startupmanager.get(cat: .zinit)!
|
||||
}
|
||||
.systemd {
|
||||
console.print_debug('startupmanager: systemd')
|
||||
return startupmanager.get(cat: .systemd)!
|
||||
}
|
||||
else {
|
||||
console.print_debug('startupmanager: auto')
|
||||
return startupmanager.get()!
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@[params]
|
||||
pub struct InstallArgs {
|
||||
pub mut:
|
||||
@@ -88,10 +77,3 @@ pub fn (mut self Tailwind) destroy() ! {
|
||||
pub fn switch(name string) {
|
||||
tailwind4_default = name
|
||||
}
|
||||
|
||||
// helpers
|
||||
|
||||
@[params]
|
||||
pub struct DefaultConfigArgs {
|
||||
instance string = 'default'
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user