diff --git a/lib/find_pkg.js b/lib/find_pkg.js index 79fd3904..14028882 100644 --- a/lib/find_pkg.js +++ b/lib/find_pkg.js @@ -16,7 +16,12 @@ function checkPkg(path) { return readFile(pkgPath).then(content => { const json = JSON.parse(content); - if (typeof json.hexo === 'object') return path; + if (typeof json.hexo === 'object') { + return path + } + else { + throw "Can't find hexo in " + pkgPath; + }; }).catch(err => { if (err && err.code === 'ENOENT') { const parent = dirname(path);