Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make file() function return Path type #78

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions modules/compiler/src/main/java/script/dsl/ScriptDsl.java
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,14 @@ The directory where a module script is located (equivalent to `projectDir` if us
void exit(int exitCode, String message);

@Description("""
Get one or more files from a path or glob pattern. Returns a Path or list of Paths if there are multiple files.
Get a file from a path or glob pattern. Returns a collection if there are zero or multiple files.

*NOTE: use `files()` to get a collection of files.*
""")
/* Path | Collection<Path> */
Object file(Map<String,?> opts, String filePattern);
Path file(Map<String,?> opts, String filePattern);

@Description("""
Convenience method for `file()` that always returns a list.
Get a collection of files from a path or glob pattern.
""")
Collection<Path> files(Map<String,?> opts, String filePattern);

Expand Down