Skip to content

Commit

Permalink
Escape form name when it has single quote
Browse files Browse the repository at this point in the history
  • Loading branch information
evansdianga committed Mar 10, 2021
1 parent 63785d6 commit f66b2dc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions server/src/scripts/generate-csv/bin.js
Expand Up @@ -61,8 +61,9 @@ async function go(state) {
// Run batches.
while (state.complete === false) {
console.log(`Run batch at skip of ${state.skip} at statePath: ${state.statePath}`)
await exec(`./batch.js '${state.statePath}'`)
state = JSON.parse(await readFile(state.statePath))
const statePath = state.statePath.replace(/'/g, "\\'")
await exec(`./batch.js '${statePath}'`)
state = JSON.parse(await readFile(statePath))
await sleep(state.sleepTimeBetweenBatches)
}
process.exit()
Expand Down

0 comments on commit f66b2dc

Please sign in to comment.