WIP: Building hero

- The work is still in progress

Co-authored-by: supermario <mariobassem12@gmail.com>
This commit is contained in:
Mahmoud Emad
2025-01-02 19:01:37 +02:00
parent b29a57ea34
commit 4c01c88b85
103 changed files with 7064 additions and 506 deletions

View File

@@ -0,0 +1,30 @@
module generic
import os
import freeflowuniverse.herolib.core.pathlib
import freeflowuniverse.herolib.ui.console
// scan over a set of directories call the play where
pub fn scan(args_ GeneratorArgs) ! {
mut args := args_
console.print_header('Scan for generation of code for path: ${args.path} (reset:${args.force}, force:${args.force})')
if args.path.len == 0 {
args.path = os.getwd()
}
// now walk over all directories, find .heroscript
mut pathroot := pathlib.get_dir(path: args.path, create: false)!
mut plist := pathroot.list(
recursive: true
ignoredefault: false
regex: ['.heroscript']
)!
for mut p in plist.paths {
pparent := p.parent()!
args.path = pparent.path
// println("-- ${pparent}")
generate(args)!
}
}