Skip to content

Commit

Permalink
Fix error on json schema validation with 21.10.0-SNAPSHOT see here nf…
Browse files Browse the repository at this point in the history
  • Loading branch information
JoseEspinosa committed Nov 9, 2021
1 parent d855e3e commit 08f8b29
Showing 1 changed file with 9 additions and 21 deletions.
30 changes: 9 additions & 21 deletions lib/NfcoreTemplate.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -19,27 +19,16 @@ class NfcoreTemplate {
}

//
// Check params.hostnames
// Warn if a -profile or Nextflow config has not been provided to run the pipeline
//
public static void hostName(workflow, params, log) {
Map colors = logColours(params.monochrome_logs)
if (params.hostnames) {
try {
def hostname = "hostname".execute().text.trim()
params.hostnames.each { prof, hnames ->
hnames.each { hname ->
if (hostname.contains(hname) && !workflow.profile.contains(prof)) {
log.info "=${colors.yellow}====================================================${colors.reset}=\n" +
"${colors.yellow}WARN: You are running with `-profile $workflow.profile`\n" +
" but your machine hostname is ${colors.white}'$hostname'${colors.reset}.\n" +
" ${colors.yellow_bold}Please use `-profile $prof${colors.reset}`\n" +
"=${colors.yellow}====================================================${colors.reset}="
}
}
}
} catch (Exception e) {
log.warn "[$workflow.manifest.name] Could not determine 'hostname' - skipping check. Reason: ${e.message}."
}
public static void checkConfigProvided(workflow, log) {
if (workflow.profile == 'standard' && workflow.configFiles.size() <= 1) {
log.warn "[$workflow.manifest.name] You are attempting to run the pipeline without any custom configuration!\n\n" +
"This will be dependent on your local compute enviroment but can be acheived via one or more of the following:\n" +
" (1) Using an existing pipeline profile e.g. `-profile docker` or `-profile singularity`\n" +
" (2) Using an existing nf-core/configs for your Institution e.g. `-profile crick` or `-profile uppmax`\n" +
" (3) Using your own local custom config e.g. `-c /path/to/your/custom.config`\n\n" +
"Please refer to the quick start section and usage docs for the pipeline.\n "
}
}

Expand Down Expand Up @@ -168,7 +157,6 @@ class NfcoreTemplate {
log.info "-${colors.purple}[$workflow.manifest.name]${colors.red} Pipeline completed successfully, but with errored process(es) ${colors.reset}-"
}
} else {
hostName(workflow, params, log)
log.info "-${colors.purple}[$workflow.manifest.name]${colors.red} Pipeline completed with errors${colors.reset}-"
}
}
Expand Down

0 comments on commit 08f8b29

Please sign in to comment.