mirror of
https://github.com/sasjs/server.git
synced 2026-01-07 06:30:06 +00:00
chore(execution): add includePrintOutput to ExecuteFileParams
This commit is contained in:
@@ -63,7 +63,7 @@ const executeCode = async (
|
|||||||
vars: { ...req.query, _debug: 131 },
|
vars: { ...req.query, _debug: 131 },
|
||||||
otherArgs: { userAutoExec },
|
otherArgs: { userAutoExec },
|
||||||
runTime: runTime,
|
runTime: runTime,
|
||||||
addPrintOutput: true
|
includePrintOutput: true
|
||||||
})
|
})
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
|||||||
@@ -29,11 +29,11 @@ interface ExecuteFileParams {
|
|||||||
session?: Session
|
session?: Session
|
||||||
runTime: RunTimeType
|
runTime: RunTimeType
|
||||||
forceStringResult?: boolean
|
forceStringResult?: boolean
|
||||||
addPrintOutput?: boolean
|
|
||||||
}
|
}
|
||||||
|
|
||||||
interface ExecuteProgramParams extends Omit<ExecuteFileParams, 'programPath'> {
|
interface ExecuteProgramParams extends Omit<ExecuteFileParams, 'programPath'> {
|
||||||
program: string
|
program: string
|
||||||
|
includePrintOutput?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
export class ExecutionController {
|
export class ExecutionController {
|
||||||
@@ -69,7 +69,7 @@ export class ExecutionController {
|
|||||||
session: sessionByFileUpload,
|
session: sessionByFileUpload,
|
||||||
runTime,
|
runTime,
|
||||||
forceStringResult,
|
forceStringResult,
|
||||||
addPrintOutput
|
includePrintOutput
|
||||||
}: ExecuteProgramParams): Promise<ExecuteReturnRaw> {
|
}: ExecuteProgramParams): Promise<ExecuteReturnRaw> {
|
||||||
const sessionController = getSessionController(runTime)
|
const sessionController = getSessionController(runTime)
|
||||||
|
|
||||||
@@ -131,7 +131,7 @@ export class ExecutionController {
|
|||||||
resultParts.push(process.logsUUID)
|
resultParts.push(process.logsUUID)
|
||||||
resultParts.push(log)
|
resultParts.push(log)
|
||||||
|
|
||||||
if (addPrintOutput && runTime === RunTimeType.SAS) {
|
if (includePrintOutput && runTime === RunTimeType.SAS) {
|
||||||
const printOutputPath = path.join(session.path, 'output.lst')
|
const printOutputPath = path.join(session.path, 'output.lst')
|
||||||
const printOutput = (await fileExists(printOutputPath))
|
const printOutput = (await fileExists(printOutputPath))
|
||||||
? await readFile(printOutputPath)
|
? await readFile(printOutputPath)
|
||||||
|
|||||||
Reference in New Issue
Block a user