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:
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user