8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 59e51a4 commit 9ff3c17Copy full SHA for 9ff3c17
bin/vue-list
@@ -24,12 +24,17 @@ request({
24
}
25
}, function (err, res, body) {
26
if (err) logger.fatal(err)
27
- console.log(' Available official templates:')
28
- console.log()
29
- JSON.parse(body).forEach(function (repo) {
30
- console.log(
31
- ' ' + chalk.yellow('★') +
32
- ' ' + chalk.blue(repo.name) +
33
- ' - ' + repo.description)
34
- })
+ var requestBody = JSON.parse(body)
+ if (Array.isArray(requestBody)) {
+ console.log(' Available official templates:')
+ console.log()
+ requestBody.forEach(function (repo) {
+ console.log(
+ ' ' + chalk.yellow('★') +
+ ' ' + chalk.blue(repo.name) +
35
+ ' - ' + repo.description)
36
+ })
37
+ } else {
38
+ console.error(requestBody.message)
39
+ }
40
})
0 commit comments