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

fix(executor): fix nosplash argument and api response

This commit is contained in:
Yury Shkoda
2021-10-06 08:16:24 +03:00
parent 707b503942
commit 715b1dec68

View File

@@ -18,7 +18,7 @@ export const processSas = async (query: ExecutionQuery): Promise<any> => {
.replace(new RegExp('/', 'g'), path.sep) .replace(new RegExp('/', 'g'), path.sep)
if (!(await fileExists(sasCodePath))) { if (!(await fileExists(sasCodePath))) {
return Promise.reject('SAS file does not exist.') return Promise.reject({ error: 'SAS file does not exist.' })
} }
const sasFile: string = sasCodePath.split(path.sep).pop() || 'default' const sasFile: string = sasCodePath.split(path.sep).pop() || 'default'
@@ -54,7 +54,7 @@ export const processSas = async (query: ExecutionQuery): Promise<any> => {
tmpSasCodePath, tmpSasCodePath,
'-log', '-log',
sasLogPath, sasLogPath,
'-nosplash' // FIXME: should be configurable process.platform === 'win32' ? '-nosplash' : ''
]).catch((err) => ({ stderr: err, stdout: '' })) ]).catch((err) => ({ stderr: err, stdout: '' }))
let log = '' let log = ''
@@ -78,12 +78,12 @@ export const processSas = async (query: ExecutionQuery): Promise<any> => {
if (debug && (query as any)[debug] >= 131) { if (debug && (query as any)[debug] >= 131) {
webout = `<html><body> webout = `<html><body>
>>weboutBEGIN<< ${webout} >>weboutEND<< ${webout}
<div style="text-align:left"> <div style="text-align:left">
<hr /><h2>SAS Log</h2> <hr /><h2>SAS Log</h2>
<pre>${log}</pre> <pre>${log}</pre>
</div> </div>
</body></html>` </body></html>`
} }
return Promise.resolve(webout) return Promise.resolve(webout)