Skip to content

Commit

Permalink
Make file() function return Path type
Browse files Browse the repository at this point in the history
Signed-off-by: Ben Sherman <[email protected]>
  • Loading branch information
bentsherman committed Nov 26, 2024
1 parent 99a6ccf commit 1ae61fc
Showing 1 changed file with 5 additions and 4 deletions.
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

0 comments on commit 1ae61fc

Please sign in to comment.