Skip to content
Permalink
Browse files

option, feat: skip package.json when the file does not exist.

  • Loading branch information...
xicilion committed Aug 9, 2019
1 parent 5820c65 commit 612271ce5479e754dfe01cd0c4bc6fc0cf82d946
Showing with 2,408 additions and 2,398 deletions.
  1. +9 −1 fibjs/scripts/opt_tools/install.js
  2. +2,399 −2,397 fibjs/src/base/opt_tools.cpp
@@ -1458,7 +1458,15 @@ function find_version(m, v, parent) {

function get_root() {
var p = process.cwd();
var info = JSON.parse(fs.readTextFile(path.join(p, 'package.json')));
var txt;

try {
txt = fs.readTextFile(path.join(p, 'package.json'));
} catch (e) {
txt = "{}";
}

var info = JSON.parse(txt);

var deps = util.clone(info.dependencies || {});
deps = util.extend(deps, info.devDependencies || {});

0 comments on commit 612271c

Please sign in to comment.
You can’t perform that action at this time.