mirror of
https://github.com/danbulant/bpm
synced 2026-06-14 03:51:07 +00:00
Fallback to cwd
This commit is contained in:
parent
d9af194dc7
commit
4c1eae1955
1 changed files with 3 additions and 1 deletions
|
|
@ -3,7 +3,9 @@ var console = new Console;
|
|||
|
||||
module.exports = class PackageParser {
|
||||
load(path){
|
||||
if (!fs.existsSync(path)) throw Error("Path doesn't exists!");
|
||||
if(!path) path = process.cwd() + "/package.json";
|
||||
|
||||
if (!fs.existsSync(path)) throw Error("Package.json doesn't exists!");
|
||||
|
||||
try {
|
||||
var json = JSON.parse(fs.readFileSync(path));
|
||||
|
|
|
|||
Loading…
Reference in a new issue