1
0
mirror of https://github.com/sasjs/adapter.git synced 2026-01-06 04:00:05 +00:00

fix(path): make log file path platform-agnostic

This commit is contained in:
Krishna Acondy
2021-07-24 09:53:39 +01:00
parent 87e2edbd6c
commit 626fc2e15f
2 changed files with 3 additions and 2 deletions

View File

@@ -8,7 +8,8 @@ export const getFileStream = async (job: Job, filePath?: string) => {
const isFolderPath = await isFolder(logPath)
if (isFolderPath) {
const logFileName = `${job.name || 'job'}-${generateTimestamp()}.log`
const logFilePath = `${filePath || process.cwd()}/${logFileName}`
const path = require('path')
const logFilePath = path.join(filePath || process.cwd(), logFileName)
return await createWriteStream(logFilePath)
} else {
return await createWriteStream(logPath)