File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2020 Junjun Zhang
2121*/
2222
23- /*
24- This is an auto-generated checker workflow to test the generated main template workflow, it's
25- meant to illustrate how testing works. Please update to suit your own needs.
26- */
27-
28- /* *******************************************************************/
29- /* this block is auto-generated based on info from pkg.json where */
30- /* changes can be made if needed, do NOT modify this block manually */
3123nextflow. enable. dsl = 2
32- version = ' 1.0.0' // package version
33-
34- container = [
35- ' ghcr.io' : ' ghcr.io/icgc-argo/data-processing-utility-tools.cleanup-workdir'
36- ]
37- default_container_registry = ' ghcr.io'
38- /* *******************************************************************/
3924
4025// universal params
4126params. container_registry = " "
@@ -98,7 +83,7 @@ workflow {
9883 // perform cleanup in gFile1 workdir
9984 cleanupWorkdir(
10085 gFile1. out. collect(),
101- gFile2 . out. file . collect() // flag enables waiting for gFile2 before cleaning up gFile1 workdir
86+ fExist1 . out. collect() // flag enables waiting for fExist1 before cleaning up gFile1 workdir
10287 )
10388
10489 // test cleaned up workdir from gFile1 indeed does not have previous files
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ nextflow.enable.dsl = 2
2929version = ' 1.0.0' // package version
3030
3131container = [
32- ' ghcr.io' : ' ghcr.io/icgc-argo/data-processing-utility-tools.helper-functions '
32+ ' ghcr.io' : ' ghcr.io/icgc-argo/data-processing-utility-tools.cleanup-workdir '
3333]
3434default_container_registry = ' ghcr.io'
3535/* *******************************************************************/
@@ -49,23 +49,29 @@ process filesExist {
4949 path files
5050 val dependency_flag // any output from process(es) you'd like to make this process depend on
5151
52+ output:
53+ stdout()
54+
5255 script:
5356 file_name_arg = file_names instanceof List ? file_names. join(" " ) : file_names
5457 """
5558 if [[ "${ expect} " = "exist" ]]; then
5659 for f in \$ (echo "${ file_name_arg} "); do
5760 if [[ ! -f \$ f ]]; then
58- exit "Expected \$ f not exists."
61+ echo "Expected \$ f not exists."
62+ exit 1
5963 fi
6064 done
6165 elif [[ "${ expect} " = "not_exist" ]]; then
6266 for f in \$ (echo "${ file_name_arg} "); do
6367 if [[ -f \$ f ]]; then
64- exit "Unexpected \$ f exists."
68+ echo "Unexpected \$ f exists."
69+ exit 1
6570 fi
6671 done
6772 else
68- exit "Second argument must be either 'exist' or 'not_exist'. '${ expect} ' is supplied."
73+ echo "Second argument must be either 'exist' or 'not_exist'. '${ expect} ' is supplied."
74+ exit 1
6975 fi
7076 """
7177}
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ nextflow.enable.dsl = 2
2929version = ' 1.0.0' // package version
3030
3131container = [
32- ' ghcr.io' : ' ghcr.io/icgc-argo/data-processing-utility-tools.helper-functions '
32+ ' ghcr.io' : ' ghcr.io/icgc-argo/data-processing-utility-tools.cleanup-workdir '
3333]
3434default_container_registry = ' ghcr.io'
3535/* *******************************************************************/
You can’t perform that action at this time.
0 commit comments