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:
@@ -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
16
src/utils/tmpFiles.ts
Normal 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')
|
||||
Reference in New Issue
Block a user