Skip to content

Commit

Permalink
fixing faulty version check
Browse files Browse the repository at this point in the history
  • Loading branch information
replikation committed Feb 15, 2022
1 parent 8313e60 commit a8fb1c4
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,17 @@ def helpMSG() {
"""
}

if( !nextflow.version.matches('20.+') ) {
ch_ver=Channel.from("This workflow requires Nextflow version 20.07 or greater -- You are running version $nextflow.version").view()
exit 1
XX = "21"
YY = "04"
ZZ = "0"

if ( nextflow.version.toString().tokenize('.')[0].toInteger() < XX.toInteger() ) {
println "\033[0;33mporeCov requires at least Nextflow version " + XX + "." + YY + "." + ZZ + " -- You are using version $nextflow.version\u001B[0m"
exit 1
}
else if ( nextflow.version.toString().tokenize('.')[1].toInteger() == XX.toInteger() && nextflow.version.toString().tokenize('.')[1].toInteger() < YY.toInteger() ) {
println "\033[0;33mporeCov requires at least Nextflow version " + XX + "." + YY + "." + ZZ + " -- You are using version $nextflow.version\u001B[0m"
exit 1
}

workflow { //start of the workflow
Expand Down

0 comments on commit a8fb1c4

Please sign in to comment.