Skip to content

Commit db3f29d

Browse files
committed
Fix issue #16 - linkObject is not defined
1 parent 5edc516 commit db3f29d

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

app.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,12 @@ const outputFileName = argv.filename
2626
// callback function for getting input from prompt
2727

2828
const getAuth = function (auth, silent, callback) {
29-
read({prompt: `${auth}: `, silent: silent}, function (er, password) {
29+
read({ prompt: `${auth}: `, silent: silent }, function (er, password) {
3030
callback(password)
3131
})
3232
}
3333

3434
// callback function for getting requested options
35-
3635
const getRequestedOptions = exports.getRequestedOptions = function (username, password, url, callback) {
3736
const requestOptions = {
3837
headers: {
@@ -86,14 +85,13 @@ const getRequestedOptions = exports.getRequestedOptions = function (username, pa
8685
const main = exports.main = function (data, requestedOptions) {
8786
logExceptOnTest('Requesting API...')
8887
requestBody(requestedOptions, (error, response, body) => {
89-
linkObject = responseToObject(response.headers)
88+
const linkObject = responseToObject(response.headers)
89+
9090
if (error) {
9191
chalk.red('There has been an error requesting data from GitHub')
9292
console.error(error)
9393
}
9494

95-
const linkObject = responseToObject(response.headers)
96-
9795
// take body, parse it and add it to data
9896

9997
data = _.concat(data, body)
@@ -211,4 +209,4 @@ function logExceptOnTest (string) {
211209

212210
const argvRepository = argv._[argv._.length - 1]
213211

214-
this.execute(argvRepository)
212+
execute(argvRepository)

test/app-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const dummyData = require('./dummy-data')
1010

1111
const getRequestedOptions = app.getRequestedOptions
1212
const convertJsonToCsv = app.convertJSonToCsv
13-
const main = app.main
13+
// const main = app.main
1414

1515
describe('downloadGitIssues', function () {
1616
process.env.NODE_ENV = 'test'

0 commit comments

Comments
 (0)