Skip to content

Commit 65b2906

Browse files
authored
Update process.rst [ci skip]
Signed-off-by: Ben Sherman <bentshermann@gmail.com>
1 parent 3a53dee commit 65b2906

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

docs/process.rst

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -537,18 +537,21 @@ section::
537537
foo('/some/data/file.txt')
538538
}
539539

540-
In the case an input `path` doesn't exist, the process will be aborted. If you want the process will be executed
541-
independently if the file exists or not, you can set the attribute `nullable` as true:
540+
If a ``path`` input doesn't exist, the process will fail. You can make a process execute in this case
541+
by making the path ``nullable``::
542542

543543
process foo {
544544
input:
545-
path x, stageAs: 'data.txt', nullable:true from '/some/data/file.txt'
545+
tuple val(v), path(x, stageAs: 'data.txt', nullable: true)
546546

547547
"""
548548
[[ -f data.txt ]] your_command --in data.txt || other_command
549549
"""
550550
}
551551

552+
Nullable paths are useful when a process emits or receives a tuple containing a path that may not exist.
553+
With a nullable path, you can handle the null case directly in your process script.
554+
552555

553556
Multiple input files
554557
--------------------
@@ -1016,7 +1019,7 @@ Name Description
10161019
``type`` Type of paths returned, either ``file``, ``dir`` or ``any`` (default: ``any``, or ``file`` if the specified file name pattern contains a double star (``**``))
10171020
``maxDepth`` Maximum number of directory levels to visit (default: no limit)
10181021
``includeInputs`` When ``true`` any input files matching an output file glob pattern are included.
1019-
``nullable`` When ``true`` emit a NullablePath instead to abort the process
1022+
``nullable`` When ``true`` emit a null path instead of failing, if the output path doesn't exist
10201023
================== =====================
10211024

10221025

0 commit comments

Comments
 (0)