From b4f2adc4c970b15b879885d74bc0d58d19efa7e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Go=C5=82aszewski?= Date: Fri, 11 Jan 2019 12:20:28 +0100 Subject: [PATCH] Exclude master repo package from require it. --- lib/index.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/index.js b/lib/index.js index b083ecc..886a010 100644 --- a/lib/index.js +++ b/lib/index.js @@ -5,6 +5,7 @@ 'use strict'; +const path = require( 'upath' ); const chalk = require( 'chalk' ); const createForkPool = require( './utils/createforkpool' ); const displayLog = require( './utils/displaylog' ); @@ -26,8 +27,10 @@ module.exports = function( args, options ) { return; } + const cwd = getCwd(); + const mainPackageName = require( path.resolve( cwd, 'package.json' ) ).name; const startTime = process.hrtime(); - const mgitOptions = getOptions( options, getCwd() ); + const mgitOptions = getOptions( options, cwd ); const repositoryResolver = require( mgitOptions.resolverPath ); const forkPool = createForkPool( CHILD_PROCESS_PATH ); @@ -65,6 +68,11 @@ module.exports = function( args, options ) { return; } + // Do not enqueue main package even if other package from dependencies require it. + if ( packageName === mainPackageName ) { + return; + } + processedPackages.add( packageName ); const data = {