Skip to content
Snippets Groups Projects
Commit e505c92f authored by George Marchment's avatar George Marchment
Browse files

Adding case the workflow is just written in one file -> so no includes (no ankers for rewrite)

parent 8be0c110
No related branches found
No related tags found
No related merge requests found
Pipeline #14428 failed with stage
in 2 minutes and 39 seconds
......@@ -444,9 +444,17 @@ George Marchment, Bryan Brancotte, Marie Schmit, Frédéric Lemoine, Sarah Cohen
to_replace = []
for match in re.finditer(constant.FULL_INLCUDE_2, code):
to_replace.append(match.group(0))
for r in to_replace:
code = code.replace(r, ankers)
ankers = ""
if(to_replace==[]):
pos_start = 0
start_code_pattern = r"\#\!\s*\/usr\/bin\/env\s+nextflow"
for match in re.finditer(start_code_pattern, code):
pos_start = match.span(0)[1]+1
code = code[:pos_start]+ankers+code[pos_start:]
else:
for r in to_replace:
code = code.replace(r, ankers)
ankers = ""
processes, subworkflows, functions = [], [], []
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment