Skip to content

Commit b483d28

Browse files
committed
Merge branch 'release/v0.1.1'
2 parents 0760113 + ca2cd2f commit b483d28

File tree

3 files changed

+37
-23
lines changed

3 files changed

+37
-23
lines changed

app.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#!/usr/bin/env node
2-
32
const fs = require('fs')
43
const request = require('request')
54
const _ = require('lodash')
@@ -26,7 +25,7 @@ const outputFileName = argv.filename
2625

2726
// callback function for getting input from prompt
2827

29-
getAuth = function (auth, silent, callback) {
28+
const getAuth = function (auth, silent, callback) {
3029
read({prompt: `${auth}: `, silent: silent}, function (er, password) {
3130
callback(password)
3231
})
@@ -88,6 +87,12 @@ const main = exports.main = function (data, requestedOptions) {
8887
logExceptOnTest('Requesting API...')
8988
requestBody(requestedOptions, (error, response, body) => {
9089
linkObject = responseToObject(response.headers)
90+
if (error) {
91+
chalk.red('There has been an error requesting data from GitHub')
92+
console.error(error)
93+
}
94+
95+
const linkObject = responseToObject(response.headers)
9196

9297
// take body, parse it and add it to data
9398

@@ -157,6 +162,9 @@ const requestBody = exports.requestBody = function (requestedOptions, callback)
157162
case 'Bad credentials':
158163
logExceptOnTest(chalk.red('\nYour username or password is invalid, please check it'))
159164
break
165+
case 'Must specify two-factor authentication OTP code.':
166+
logExceptOnTest(chalk.red('\nYour acoount requires two-factor authentication.\nUnfortunatelly, this is currently not supported.'))
167+
break
160168
default:
161169
logExceptOnTest(chalk.red('\nRepository have 0 issues. Nothing to download'))
162170
}

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "git-issues-downloader",
3-
"version": "0.1.0",
3+
"version": "0.1.1",
44
"main": "app.js",
55
"license": "MIT",
66
"scripts": {
@@ -23,7 +23,7 @@
2323
"moment": "^2.18.1",
2424
"read": "^1.0.7",
2525
"request": "^2.81.0",
26-
"sinon": "^4.4.8",
26+
"sinon": "^6.0.1",
2727
"yargs": "^11.0.0"
2828
},
2929
"bin": {

yarn.lock

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -442,14 +442,10 @@ delayed-stream@~1.0.0:
442442
version "1.0.0"
443443
resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619"
444444

445-
445+
[email protected], diff@^3.5.0:
446446
version "3.5.0"
447447
resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12"
448448

449-
diff@^3.1.0:
450-
version "3.2.0"
451-
resolved "https://registry.yarnpkg.com/diff/-/diff-3.2.0.tgz#c9ce393a4b7cbd0b058a725c93df299027868ff9"
452-
453449
454450
version "1.5.0"
455451
resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-1.5.0.tgz#379dce730f6166f76cefa4e6707a159b02c5a6fa"
@@ -1242,10 +1238,14 @@ lodash@^4.17.4, lodash@^4.3.0:
12421238
version "4.17.4"
12431239
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae"
12441240

1245-
lolex@^2.2.0, lolex@^2.3.2:
1241+
lolex@^2.3.2:
12461242
version "2.3.2"
12471243
resolved "https://registry.yarnpkg.com/lolex/-/lolex-2.3.2.tgz#85f9450425103bf9e7a60668ea25dc43274ca807"
12481244

1245+
lolex@^2.4.2:
1246+
version "2.7.0"
1247+
resolved "https://registry.yarnpkg.com/lolex/-/lolex-2.7.0.tgz#9c087a69ec440e39d3f796767cf1b2cdc43d5ea5"
1248+
12491249
longest@^1.0.1:
12501250
version "1.0.1"
12511251
resolved "https://registry.yarnpkg.com/longest/-/longest-1.0.1.tgz#30a0b2da38f73770e8294a0d22e6625ed77d0097"
@@ -1334,9 +1334,9 @@ natural-compare@^1.4.0:
13341334
version "1.4.0"
13351335
resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7"
13361336

1337-
nise@^1.2.0:
1338-
version "1.3.2"
1339-
resolved "https://registry.yarnpkg.com/nise/-/nise-1.3.2.tgz#fd6fd8dc040dfb3c0a45252feb6ff21832309b14"
1337+
nise@^1.3.3:
1338+
version "1.4.2"
1339+
resolved "https://registry.yarnpkg.com/nise/-/nise-1.4.2.tgz#a9a3800e3994994af9e452333d549d60f72b8e8c"
13401340
dependencies:
13411341
"@sinonjs/formatio" "^2.0.0"
13421342
just-extend "^1.1.27"
@@ -1743,17 +1743,17 @@ signal-exit@^3.0.0, signal-exit@^3.0.2:
17431743
version "3.0.2"
17441744
resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d"
17451745

1746-
sinon@^4.4.8:
1747-
version "4.4.8"
1748-
resolved "https://registry.yarnpkg.com/sinon/-/sinon-4.4.8.tgz#0479e0ccb8caa0d737ce9773c8d53d57d38f2d84"
1746+
sinon@^6.0.1:
1747+
version "6.0.1"
1748+
resolved "https://registry.yarnpkg.com/sinon/-/sinon-6.0.1.tgz#4247b97dd8fecbe1e19f8b816a5e7eed3993bcfe"
17491749
dependencies:
17501750
"@sinonjs/formatio" "^2.0.0"
1751-
diff "^3.1.0"
1751+
diff "^3.5.0"
17521752
lodash.get "^4.4.2"
1753-
lolex "^2.2.0"
1754-
nise "^1.2.0"
1755-
supports-color "^5.1.0"
1756-
type-detect "^4.0.5"
1753+
lolex "^2.4.2"
1754+
nise "^1.3.3"
1755+
supports-color "^5.4.0"
1756+
type-detect "^4.0.8"
17571757

17581758
17591759
version "1.0.0"
@@ -1911,12 +1911,18 @@ supports-color@^3.1.0:
19111911
dependencies:
19121912
has-flag "^1.0.0"
19131913

1914-
supports-color@^5.1.0, supports-color@^5.3.0:
1914+
supports-color@^5.3.0:
19151915
version "5.3.0"
19161916
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.3.0.tgz#5b24ac15db80fa927cf5227a4a33fd3c4c7676c0"
19171917
dependencies:
19181918
has-flag "^3.0.0"
19191919

1920+
supports-color@^5.4.0:
1921+
version "5.4.0"
1922+
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.4.0.tgz#1c6b337402c2137605efe19f10fec390f6faab54"
1923+
dependencies:
1924+
has-flag "^3.0.0"
1925+
19201926
19211927
version "4.0.2"
19221928
resolved "https://registry.yarnpkg.com/table/-/table-4.0.2.tgz#a33447375391e766ad34d3486e6e2aedc84d2e36"
@@ -1976,7 +1982,7 @@ type-detect@^4.0.0:
19761982
version "4.0.3"
19771983
resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.3.tgz#0e3f2670b44099b0b46c284d136a7ef49c74c2ea"
19781984

1979-
type-detect@^4.0.5:
1985+
type-detect@^4.0.8:
19801986
version "4.0.8"
19811987
resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c"
19821988

0 commit comments

Comments
 (0)