fix: correct generator command and templates

- Correct the `generator` command to use a string flag for the path.
- Update templates to use correct heap allocation annotation.
- Remove unnecessary code in templates.

Co-authored-by: mahmmoud.hassanein <mahmmoud.hassanein@gmail.com>
This commit is contained in:
2025-01-14 11:41:50 +02:00
parent dac3b61116
commit 0b780b6901
4 changed files with 5 additions and 6 deletions

View File

@@ -88,7 +88,7 @@ fn do() ! {
// herocmds.cmd_caddy(mut cmd)
// herocmds.cmd_zola(mut cmd)
// herocmds.cmd_juggler(mut cmd)
// herocmds.cmd_generator(mut cmd)
herocmds.cmd_generator(mut cmd)
// herocmds.cmd_docsorter(mut cmd)
// cmd.add_command(publishing.cmd_publisher(pre_func))
cmd.setup()

View File

@@ -115,9 +115,8 @@ pub fn play(args_ PlayArgs) ! {
if install_actions.len > 0 {
for install_action in install_actions {
mut p := install_action.params
mycfg:=cfg_play(p)!
cfg_play(p)!
console.print_debug("install action ${args.name}.configure\n??{mycfg}")
set(mycfg)!
}
}
@end

View File

@@ -44,7 +44,7 @@ pub fn heroscript_default() !string {
//THIS THE THE SOURCE OF THE INFORMATION OF THIS FILE, HERE WE HAVE THE CONFIG OBJECT CONFIGURED AND MODELLED
@if args.cat == .installer
@[heap]
^^[heap]
pub struct ${args.classname} {
pub mut:
name string = 'default'
@@ -83,7 +83,7 @@ fn cfg_play(p paramsparser.Params) !${args.classname} {
@else
@[heap]
^^[heap]
pub struct ${args.classname} {
pub mut:
name string = 'default'

View File

@@ -21,7 +21,7 @@ pub fn cmd_generator(mut cmdroot Command) {
})
cmd_run.add_flag(Flag{
flag: .bool
flag: .string
required: false
name: 'path'
abbrev: 'p'