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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user