fix: add work-logs config

This commit is contained in:
Mrugesh Mohapatra
2018-11-13 02:31:51 +05:30
committed by mrugesh mohapatra
parent 4c59c0565b
commit bf09121c1f
4 changed files with 85 additions and 4 deletions

View File

@@ -1,7 +1,10 @@
require('dotenv').config();
const { owner, repo, fccBaseUrl, prBaseUrl } = require('./constants');
const path = require('path');
const fs = require('fs');
const formatDate = require('date-fns/format');
const { owner, repo, fccBaseUrl, prBaseUrl } = require('./constants');
const { saveToFile, openJSONFile } = require('./fileFunctions');
const { octokitConfig, octokitAuth } = require('./octokitConfig');
const octokit = require('@octokit/rest')(octokitConfig);
@@ -27,7 +30,7 @@ const prPropsToGet = ['number', 'labels', 'user'];
console.log(`# of PRs Retrieved: ${openPRs.length}`);
console.log(`PR Range: ${firstPR} - ${lastPR}`);
const now = formatDate(new Date(), 'YYYY-MM-DDTHHmmss');
const fileName = `data/openprs_${firstPR}-${lastPR}_${now}.json`;
const fileName = path.resolve(__dirname, `./data/openprs_${firstPR}-${lastPR}_${now}.json`);
saveToFile(fileName, JSON.stringify(openPRs));
console.log(`Data saved in file: ${fileName}`);