Add final tweaks to CQ customizer

This commit is contained in:
Kurt Hutten
2021-10-10 15:46:34 +11:00
parent 95877f6dc7
commit 75c7e433f2
4 changed files with 39 additions and 25 deletions

View File

@@ -42,7 +42,7 @@ RUN npm install aws-lambda-ric@1.0.0
RUN wget \
https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh \
&& bash Miniconda3-latest-Linux-x86_64.sh -b \
&& rm -f Miniconda3-latest-Linux-x86_64.sh
&& rm -f Miniconda3-latest-Linux-x86_64.sh
RUN conda --version
# Install CadQuery

View File

@@ -12,7 +12,7 @@ export const runCQ = async ({
{
file: JSON.stringify(parameters),
fileName: 'params.json',
}
},
],
'a' + nanoid() // 'a' ensure nothing funny happens if it start with a bad character like "-", maybe I should pick a safer id generator :shrug:
)
@@ -36,12 +36,12 @@ export const runCQ = async ({
console.log('command', mainCommand)
let consoleMessage = ''
try {
;([consoleMessage] = await Promise.all([
;[consoleMessage] = await Promise.all([
runCommand(mainCommand, 30000),
runCommand(customizerCommand, 30000)
]))
runCommand(customizerCommand, 30000),
])
const params = JSON.parse(
await readFile(customizerPath, { encoding: 'ascii'})
await readFile(customizerPath, { encoding: 'ascii' })
)
await writeFiles(
[
@@ -63,6 +63,6 @@ export const runCQ = async ({
)
return { consoleMessage, fullPath }
} catch (error) {
return { error: consoleMessage, fullPath }
return { error: consoleMessage || error, fullPath }
}
}