File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -81,7 +81,13 @@ module.exports = {
8181 } ) ;
8282
8383 progress ( 'Applying Cosmos DB script ...' ) ;
84- const cosmosDBScript = JSON . parse ( _ . get ( data , 'script[1].script' , '""' ) ) ;
84+ const splittedScript = data . script . split ( '\n' ) ;
85+ let cosmosDBStartLineNumber = splittedScript . indexOf ( '{' ) ;
86+ if ( cosmosDBStartLineNumber === - 1 ) {
87+ cosmosDBStartLineNumber = splittedScript . length ;
88+ }
89+ let gremlinScript = splittedScript . slice ( 0 , cosmosDBStartLineNumber ) . join ( '\n' ) ;
90+ let cosmosDBScript = JSON . parse ( splittedScript . slice ( cosmosDBStartLineNumber ) . join ( '\n' ) || '""' ) ;
8591
8692 progress ( 'Update indexing policy ...' ) ;
8793
@@ -109,8 +115,6 @@ module.exports = {
109115 await applyToInstanceHelper . createTriggers ( triggers , containerResponse . container ) ;
110116 }
111117
112- const gremlinScript = _ . get ( data , 'script[0].script' , '' ) ;
113-
114118 if ( ! gremlinScript ) {
115119 return cb ( ) ;
116120 }
You can’t perform that action at this time.
0 commit comments