Skip to content

Commit 32a17d6

Browse files
committed
Make file() function return Path type
Signed-off-by: Ben Sherman <[email protected]>
1 parent 1653dd8 commit 32a17d6

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

modules/compiler/src/main/java/script/dsl/ScriptDsl.java

+5-4
Original file line numberDiff line numberDiff line change
@@ -103,13 +103,14 @@ The directory where a module script is located (equivalent to `projectDir` if us
103103
void exit(int exitCode, String message);
104104

105105
@Description("""
106-
Get one or more files from a path or glob pattern. Returns a Path or list of Paths if there are multiple files.
106+
Get a file from a path or glob pattern.
107+
108+
*NOTE: This function will return a collection if the glob pattern yields zero or multiple files. Use `files()` to get a collection of files.*
107109
""")
108-
/* Path | Collection<Path> */
109-
Object file(Map<String,?> opts, String filePattern);
110+
Path file(Map<String,?> opts, String filePattern);
110111

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

0 commit comments

Comments
 (0)