mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-01-31 19:02:59 +01:00
use depth of 1 when doing plugin-install
This commit is contained in:
parent
bc72cbe88a
commit
7d96ea1e32
1 changed files with 4 additions and 6 deletions
|
@ -90,7 +90,6 @@ as far as the left-most node_modules folder.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
const npm = require('npm/lib/npm.js');
|
|
||||||
const fs = require('graceful-fs');
|
const fs = require('graceful-fs');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const asyncMap = require('slide').asyncMap;
|
const asyncMap = require('slide').asyncMap;
|
||||||
|
@ -116,8 +115,8 @@ const readInstalled = (folder, cb) => {
|
||||||
* new code there is */
|
* new code there is */
|
||||||
rpSeen = {};
|
rpSeen = {};
|
||||||
riSeen = [];
|
riSeen = [];
|
||||||
const d = npm.config.get('depth');
|
const depth = 1;
|
||||||
readInstalled_(folder, null, null, null, 0, d, (er, obj) => {
|
readInstalled_(folder, null, null, null, 0, depth, (er, obj) => {
|
||||||
if (er) return cb(er);
|
if (er) return cb(er);
|
||||||
// now obj has all the installed things, where they're installed
|
// now obj has all the installed things, where they're installed
|
||||||
// figure out the inheritance links, now that the object is built.
|
// figure out the inheritance links, now that the object is built.
|
||||||
|
@ -130,8 +129,6 @@ module.exports = readInstalled;
|
||||||
|
|
||||||
let rpSeen = {};
|
let rpSeen = {};
|
||||||
const readInstalled_ = (folder, parent, name, reqver, depth, maxDepth, cb) => {
|
const readInstalled_ = (folder, parent, name, reqver, depth, maxDepth, cb) => {
|
||||||
// console.error(folder, name)
|
|
||||||
|
|
||||||
let installed,
|
let installed,
|
||||||
obj,
|
obj,
|
||||||
real,
|
real,
|
||||||
|
@ -281,6 +278,7 @@ const findUnmet = (obj) => {
|
||||||
}' but will load\n${
|
}' but will load\n${
|
||||||
found.path},\nwhich is version ${found.version}`
|
found.path},\nwhich is version ${found.version}`
|
||||||
, 'unmet dependency');
|
, 'unmet dependency');
|
||||||
|
found = {};
|
||||||
found.invalid = true;
|
found.invalid = true;
|
||||||
}
|
}
|
||||||
deps[d] = found;
|
deps[d] = found;
|
||||||
|
@ -307,13 +305,13 @@ if (module === require.main) {
|
||||||
console.error('testing');
|
console.error('testing');
|
||||||
|
|
||||||
let called = 0;
|
let called = 0;
|
||||||
|
|
||||||
readInstalled(process.cwd(), (er, map) => {
|
readInstalled(process.cwd(), (er, map) => {
|
||||||
console.error(called++);
|
console.error(called++);
|
||||||
if (er) return console.error(er.stack || er.message);
|
if (er) return console.error(er.stack || er.message);
|
||||||
cleanup(map);
|
cleanup(map);
|
||||||
console.error(util.inspect(map, true, 10, true));
|
console.error(util.inspect(map, true, 10, true));
|
||||||
});
|
});
|
||||||
|
|
||||||
const seen = [];
|
const seen = [];
|
||||||
const cleanup = (map) => {
|
const cleanup = (map) => {
|
||||||
if (seen.indexOf(map) !== -1) return;
|
if (seen.indexOf(map) !== -1) return;
|
||||||
|
|
Loading…
Reference in a new issue