1
0
mirror of https://github.com/sasjs/adapter.git synced 2025-12-10 17:04:36 +00:00

chore(utils): add tmpFolder utils

This commit is contained in:
Yury Shkoda
2021-09-28 10:39:54 +03:00
parent d8b1a72da2
commit 5f3416ecd7
2 changed files with 17 additions and 0 deletions

View File

@@ -17,3 +17,4 @@ export * from './fetchLogByChunks'
export * from './getValidJson'
export * from './parseViyaDebugResponse'
export * from './appendExtraResponseAttributes'
export * from './tmpFiles'

16
src/utils/tmpFiles.ts Normal file
View File

@@ -0,0 +1,16 @@
import * as path from 'path'
import { getRealPath, folderExists, createFolder } from '@sasjs/utils'
export const getTmpFolderPath = async () => {
const tmpFolderPath = path.join(__dirname, '..', 'tmp')
if (!(await folderExists(tmpFolderPath))) await createFolder(tmpFolderPath)
return tmpFolderPath
}
export const getTmpFilesFolderPath = async () =>
path.join(await getTmpFolderPath(), 'files')
export const getTmpLogFolderPath = async () =>
path.join(await getTmpFolderPath(), 'log')