Skip to content

Commit

Permalink
add more details and examples
Browse files Browse the repository at this point in the history
  • Loading branch information
maxulysse committed Oct 1, 2024
1 parent 266fde9 commit 1e35b22
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,18 @@ By using `getRelativePath()` we generate in the snapshot:
]
```

While we only a flat structure without this function:
A reduced list can be generated by using the `getAllFilesFromDir()` not to output the folders.

```text
"content": [
[
"stable/stable_content.txt",
"stable/stable_name.txt"
]
]
```

While only a flat structure would be generated without using `getRelativePath()` and using `*.name` to capture the file names.

```text
"content": [
Expand Down
4 changes: 3 additions & 1 deletion tests/getRelativePath/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@ nextflow_pipeline {
then {
// Use getAllFilesFromDir() to get a list of all files and folders from the output directory, minus the timestamped files
def stable_name = getAllFilesFromDir(params.outdir, true, ['pipeline_info/execution_*.{html,txt}'], null )
def stable_file = getAllFilesFromDir(params.outdir, false, ['pipeline_info/execution_*.{html,txt}'], null )
assert snapshot(
// Use getRelativePath to get the relative path starting from outputDir
getRelativePath(stable_name, outputDir)
getRelativePath(stable_name, outputDir),
getRelativePath(stable_file, outputDir)
).match()
}
}
Expand Down
8 changes: 6 additions & 2 deletions tests/getRelativePath/main.nf.test.snap
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,16 @@
"stable",
"stable/stable_content.txt",
"stable/stable_name.txt"
],
[
"stable/stable_content.txt",
"stable/stable_name.txt"
]
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.04.4"
},
"timestamp": "2024-10-01T18:07:03.886102"
"timestamp": "2024-10-01T18:20:38.379963"
}
}
}

0 comments on commit 1e35b22

Please sign in to comment.