Skip to content

Commit

Permalink
fix(ui): bail on error reading package.json, closes #1599
Browse files Browse the repository at this point in the history
  • Loading branch information
Guillaume Chau committed Jun 17, 2018
1 parent 0ba5e09 commit 3ebb104
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions packages/@vue/cli-ui/src/graphql-api/connectors/folders.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,15 @@ function writePackage ({ file, data }, context) {
function isVueProject (file, context) {
if (!isPackage(file)) return false

const pkg = readPackage(file, context)
return Object.keys(pkg.devDependencies || {}).includes('@vue/cli-service')
try {
const pkg = readPackage(file, context)
return Object.keys(pkg.devDependencies || {}).includes('@vue/cli-service')
} catch (e) {
if (process.env.VUE_APP_CLI_UI_DEV) {
console.log(e)
}
}
return false
}

function listFavorite (context) {
Expand Down

0 comments on commit 3ebb104

Please sign in to comment.