Skip to content

Commit

Permalink
Document API differences of process path inputs
Browse files Browse the repository at this point in the history
Signed-off-by: Ben Sherman <[email protected]>
  • Loading branch information
bentsherman committed Aug 11, 2023
1 parent a66b0e6 commit 9cde63c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions docs/process.md
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,16 @@ workflow {
}
```

:::{note}
Process `path` inputs have nearly the same interface as described in {ref}`script-file-io`, with one difference which is relevant when files are staged into a subdirectory. Given the following input:

```groovy
path x, stageAs: 'my-dir/*'
```

In this case, `x.name` returns the file name with the parent directory (e.g. `my-dir/file.txt`), whereas normally it would return the file name (e.g. `file.txt`). You can use `x.fileName.name` to get the file name.
:::

### Multiple input files

A `path` input can also accept a collection of files instead of a single value. In this case, the input variable will be a Groovy list, and you can use it as such.
Expand Down

0 comments on commit 9cde63c

Please sign in to comment.