This commit is contained in:
2025-08-25 06:29:42 +02:00
parent 607b2b0881
commit c6d703b860
38 changed files with 846 additions and 845 deletions

View File

@@ -16,9 +16,9 @@ pub fn scan(args_ GeneratorArgs) ! {
// now walk over all directories, find .heroscript
mut pathroot := pathlib.get_dir(path: args.path, create: false)!
mut plist := pathroot.list(
recursive: true
recursive: true
ignore_default: false
regex: ['.heroscript']
regex: ['.heroscript']
)!
for mut p in plist.paths {

View File

@@ -8,12 +8,12 @@ import freeflowuniverse.herolib.ui.console
@[params]
pub struct ListArgs {
pub mut:
regex []string
recursive bool = true
regex []string
recursive bool = true
ignore_default bool = true // ignore files starting with . and _
include_links bool // wether to include links in list
dirs_only bool
files_only bool
include_links bool // wether to include links in list
dirs_only bool
files_only bool
}
// the result of pathlist
@@ -54,12 +54,12 @@ pub fn (mut path Path) list(args_ ListArgs) !PathList {
r << re
}
mut args := ListArgsInternal{
regex: r
recursive: args_.recursive
regex: r
recursive: args_.recursive
ignore_default: args_.ignore_default
dirs_only: args_.dirs_only
files_only: args_.files_only
include_links: args_.include_links
dirs_only: args_.dirs_only
files_only: args_.files_only
include_links: args_.include_links
}
paths := path.list_internal(args)!
mut pl := PathList{
@@ -72,12 +72,12 @@ pub fn (mut path Path) list(args_ ListArgs) !PathList {
@[params]
pub struct ListArgsInternal {
mut:
regex []regex.RE // only put files in which follow one of the regexes
recursive bool = true
regex []regex.RE // only put files in which follow one of the regexes
recursive bool = true
ignore_default bool = true // ignore files starting with . and _
dirs_only bool
files_only bool
include_links bool
dirs_only bool
files_only bool
include_links bool
}
fn (mut path Path) list_internal(args ListArgsInternal) ![]Path {