Skip to content

Commit

Permalink
Simplify variables
Browse files Browse the repository at this point in the history
  • Loading branch information
nwiltsie committed May 2, 2024
1 parent 42d7aa7 commit cb5618e
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions config/methods/common_methods.config
Original file line number Diff line number Diff line change
Expand Up @@ -400,28 +400,28 @@ methods {
* directory.
* Processes can customize the output directory by setting
* `process.ext.processlogdir_suffix` (can be a closure).
* `process.ext.log_dir` and `process.ext.log_dir_suffix`. Both may be
* closures.
*
* Inspired by /~https://github.com/nextflow-io/nextflow/issues/1166#issuecomment-502467562
*/
setup_process_afterscript = {
process.ext.log_dir = {
"${task.process.replace(':', '/')}"
}

process.ext.commonAfterScript = {
process_log_dir = [
"${params.log_output_dir}",
"process-log",
"${task.process.replace(':', '/')}"
"${task.ext.log_dir}${task.ext.log_dir_suffix ?: ''}"
].join("/")

// Handle relative paths
if (process_log_dir.substring(0, 1) != "/") {
process_log_dir = "${launchDir}/${process_log_dir}"
}

// Allow each process to append a suffix
if (task.ext.containsKey("processlogdir_suffix")) {
process_log_dir += task.ext.processlogdir_suffix
}

return """\
mkdir -p "${process_log_dir}"
for filename in .command.*; do
Expand Down

0 comments on commit cb5618e

Please sign in to comment.