Just replace the script: label with exec: and it will treat the process as a “native” process. No Bash script needed.
Also, remove the def from scaleFactor so that it can be referenced in the output section. It’s a quirk of processes, basically only variables declared without def can be used by the outputs.
I vaguely remembered there were some warnings about def.
something about def will create a local variables, without def could be a global variable leak to other processes (race condition)? Scripts — Nextflow documentation.
maybe i am overthinking it, since my script is very simple, probably not likely any race condition. Syntax — Nextflow documentation.
Thanks!