Skip to content

Commit ced8d0a

Browse files
committed
Add single role on setup query blocks
1 parent 0b91669 commit ced8d0a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/graphgists/asciidoc-preprocessing.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ function preprocessing(asciidoc) {
3636
let currentSourceBlockDefinition = {}
3737
let currentRoles = []
3838
const updateMap = {}
39-
lines = lines
39+
lines
4040
.map((line, index) => {
4141
if (line.startsWith('[source,cypher') && line.trim().endsWith(']')) {
4242
const blockDefintionWithRoles = addRolesInBlockDefinition(line, ['runnable', 'backend:graphgist', ...currentRoles])
@@ -54,6 +54,7 @@ function preprocessing(asciidoc) {
5454
} else if (line.includes('setup')) {
5555
// next source block should have instant role
5656
currentRoles.push('instant')
57+
currentRoles.push('single')
5758
} else if (line.includes('graph_result') && currentSourceBlockDefinition && currentSourceBlockDefinition.index) {
5859
// *previous* source block should have graph role
5960
updateMap[currentSourceBlockDefinition.index] = addRolesInBlockDefinition(currentSourceBlockDefinition.line, ['graph'])
@@ -67,7 +68,7 @@ function preprocessing(asciidoc) {
6768
return updateMap[index]
6869
}
6970
return line
70-
})
71+
}) = lines
7172
return lines.join('\n')
7273
}
7374

0 commit comments

Comments
 (0)