Merge pull request #4 from jmwright/kurt/linting-runcq

linting runCQ
This commit is contained in:
Jeremy Wright
2021-10-14 06:18:47 -04:00
committed by GitHub

View File

@@ -19,21 +19,19 @@ export const runCQ = async ({
const fullPath = `/tmp/${tempFile}/output.gz` const fullPath = `/tmp/${tempFile}/output.gz`
const stlPath = `/tmp/${tempFile}/output.stl` const stlPath = `/tmp/${tempFile}/output.stl`
const customizerPath = `/tmp/${tempFile}/customizer.json` const customizerPath = `/tmp/${tempFile}/customizer.json`
const mainCommand = [ const command = [
`./cq-cli/cq-cli.py`, `./cq-cli/cq-cli.py`,
`--codec stl`, `--codec stl`,
`--infile /tmp/${tempFile}/main.py`, `--infile /tmp/${tempFile}/main.py`,
`--outfile ${stlPath}`, `--outfile ${stlPath}`,
`--outputopts "deflection:${deflection};angularDeflection:${deflection};"`, `--outputopts "deflection:${deflection};angularDeflection:${deflection};"`,
`--params /tmp/${tempFile}/params.json`, `--params /tmp/${tempFile}/params.json`,
`--getparams ${customizerPath}` `--getparams ${customizerPath}`,
].join(' ') ].join(' ')
console.log('command', mainCommand) console.log('command', command)
let consoleMessage = '' let consoleMessage = ''
try { try {
;[consoleMessage] = await Promise.all([ consoleMessage = await runCommand(command, 30000)
runCommand(mainCommand, 30000),
])
const params = JSON.parse( const params = JSON.parse(
await readFile(customizerPath, { encoding: 'ascii' }) await readFile(customizerPath, { encoding: 'ascii' })
) )