mirror of
https://github.com/sasjs/server.git
synced 2025-12-10 19:34:34 +00:00
38 lines
892 B
TypeScript
38 lines
892 B
TypeScript
import path from 'path'
|
|
import {
|
|
CompileTree,
|
|
createFile,
|
|
loadDependenciesFile,
|
|
readFile,
|
|
SASJsFileType
|
|
} from '@sasjs/utils'
|
|
import { apiRoot, sysInitCompiledPath } from '../src/utils/file'
|
|
|
|
const macroCorePath = path.join(apiRoot, 'node_modules', '@sasjs', 'core')
|
|
|
|
const compiledSystemInit = async (systemInit: string) =>
|
|
'options ps=max;\n' +
|
|
(await loadDependenciesFile({
|
|
fileContent: systemInit,
|
|
type: SASJsFileType.job,
|
|
programFolders: [],
|
|
macroFolders: [],
|
|
buildSourceFolder: '',
|
|
binaryFolders: [],
|
|
macroCorePath,
|
|
compileTree: new CompileTree('') // dummy compileTree
|
|
}))
|
|
|
|
const createSysInitFile = async () => {
|
|
const systemInitContent = await readFile(
|
|
path.join(__dirname, 'systemInit.sas')
|
|
)
|
|
|
|
await createFile(
|
|
path.join(sysInitCompiledPath),
|
|
await compiledSystemInit(systemInitContent)
|
|
)
|
|
}
|
|
|
|
createSysInitFile()
|