From b227cbb61e39921f475ef51eb34276160872de03 Mon Sep 17 00:00:00 2001 From: Khaled Osman Date: Wed, 7 Aug 2019 14:25:36 +0200 Subject: [PATCH] fix: download report in current working directory --- commands/generateReport.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commands/generateReport.js b/commands/generateReport.js index a511011..deda2f7 100644 --- a/commands/generateReport.js +++ b/commands/generateReport.js @@ -39,7 +39,7 @@ async function generateReport (options) { spinner.update(feedbackColor(`downloading report`)) const result = await downloadReport(token, new Date(startTime), new Date(new Date(endTime).setHours(23, 59)), 'Europe/Berlin', format) spinner.update(feedbackColor(`saving to file system`)) - const fileName = `${process.env.LOGNAME}_week${getWeek(new Date())}.${format === 'xlsx' ? 'xls' : format}` + const fileName = `${process.cwd()}/${process.env.LOGNAME}_week${getWeek(new Date())}.${format === 'xlsx' ? 'xls' : format}` const writeStream = fs.createWriteStream(fileName) if (format === 'xlsx') { writeStream.write(result)