1
0
mirror of https://github.com/sasjs/server.git synced 2026-01-03 21:10:05 +00:00

fix: code/execute controller logic to handle different runtimes

This commit is contained in:
2022-06-17 20:01:50 +05:00
parent ab222cbaab
commit 23b6692f02
9 changed files with 114 additions and 64 deletions

View File

@@ -274,6 +274,7 @@ const createJSProgram = async (
)
const preProgramVarStatments = `
let _webout = '';
const weboutPath = '${weboutPath}';
const _sasjs_tokenfile = '${tokenFile}';
const _sasjs_username = '${preProgramVariables?.username}';
@@ -296,10 +297,12 @@ ${preProgramVarStatments}
/* actual job code */
${program}
/* write webout file*/
fs.writeFile(weboutPath, _webout, function (err) {
if (err) throw err;
})
/* write webout file only if webout exists*/
if (_webout) {
fs.writeFile(weboutPath, _webout, function (err) {
if (err) throw err;
})
}
`
// if no files are uploaded filesNamesMap will be undefined
if (otherArgs?.filesNamesMap) {