Skip to content

Commit

Permalink
fix: download report in current working directory
Browse files Browse the repository at this point in the history
  • Loading branch information
khaledosman committed Aug 7, 2019
1 parent 9cc5cd8 commit b227cbb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion commands/generateReport.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit b227cbb

Please sign in to comment.