Permalink
Please sign in to comment.
Showing
with
19 additions
and 4 deletions.
- +2 −1 cli.js
- +2 −1 index.js
- +2 −2 lib/ui.js
- +12 −0 lib/util.js
- +1 −0 package.json
12
lib/util.js
| @@ -0,0 +1,12 @@ | ||
| +'use strict'; | ||
| +const readPkgUp = require('read-pkg-up'); | ||
| + | ||
| +exports.readPkg = () => { | ||
| + const pkg = readPkgUp.sync().pkg; | ||
| + | ||
| + if (!pkg) { | ||
| + throw new Error(`No package.json found. Make sure you're in the correct project.`); | ||
| + } | ||
| + | ||
| + return pkg; | ||
| +}; |
0 comments on commit
0787799