1
0
mirror of https://github.com/sasjs/server.git synced 2026-01-14 17:30:05 +00:00

fix(executor): create tmp files before execution

This commit is contained in:
Yury Shkoda
2021-10-07 07:29:05 +00:00
parent 0f692efdf4
commit cdbc3fd298
3 changed files with 12 additions and 5 deletions

View File

@@ -39,6 +39,7 @@
"typescript": "^4.3.2" "typescript": "^4.3.2"
}, },
"configuration": { "configuration": {
"sasPath": "C:\\Program Files\\SASHome\\SASFoundation\\9.4\\sas.exe" "sasPath": "/opt/sas/sas9/SASHome/SASFoundation/9.4/sasexe/sas",
"sasJsPort": 5001
} }
} }

View File

@@ -28,11 +28,15 @@ export const processSas = async (query: ExecutionQuery): Promise<any> => {
generateUniqueFileName(sasFile.replace(/\.sas/g, ''), '.log') generateUniqueFileName(sasFile.replace(/\.sas/g, ''), '.log')
) )
await createFile(sasLogPath, '')
const sasWeboutPath = path.join( const sasWeboutPath = path.join(
getTmpWeboutFolderPath(), getTmpWeboutFolderPath(),
generateUniqueFileName(sasFile.replace(/\.sas/g, ''), '.json') generateUniqueFileName(sasFile.replace(/\.sas/g, ''), '.txt')
) )
await createFile(sasWeboutPath, '')
let sasCode = await readFile(sasCodePath) let sasCode = await readFile(sasCodePath)
const vars: any = query const vars: any = query

View File

@@ -1,6 +1,8 @@
import app from './app' import app from './app'
import { configuration } from '../package.json'
const port = 5000 app.listen(configuration.sasJsPort, () => {
const listener = app.listen(port, () => { console.log(
console.log(`⚡️[server]: Server is running at http://localhost:${port}`) `⚡️[server]: Server is running at http://localhost:${configuration.sasJsPort}`
)
}) })