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

chore: code fixes

This commit is contained in:
Saad Jutt
2022-06-14 16:48:58 +05:00
parent de9ed15286
commit c830f44e29
9 changed files with 343 additions and 310 deletions

View File

@@ -1,7 +1,7 @@
import path from 'path'
import { createFolder, getAbsolutePath, getRealPath } from '@sasjs/utils'
import { getDesktopFields, ModeType } from '.'
import { getDesktopFields, ModeType, RunTimeType } from '.'
export const setProcessVariables = async () => {
if (process.env.NODE_ENV === 'test') {
@@ -19,18 +19,15 @@ export const setProcessVariables = async () => {
process.sasLoc = sasLoc
}
const { SASJS_RUNTIMES } = process.env
const runTimes = SASJS_RUNTIMES
? SASJS_RUNTIMES.split(',').map((runTime) => runTime.toLowerCase())
: ['sas']
process.runTimes = runTimes
const { SASJS_ROOT } = process.env
const absPath = getAbsolutePath(SASJS_ROOT ?? 'sasjs_root', process.cwd())
await createFolder(absPath)
process.driveLoc = getRealPath(absPath)
const { RUN_TIMES } = process.env
process.runTimes = (RUN_TIMES as string).split(',') as RunTimeType[]
console.log('sasLoc: ', process.sasLoc)
console.log('sasDrive: ', process.driveLoc)
console.log('runTimes: ', process.runTimes)
}