From 10602ef743532af7087e69eafc425568385d7754 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=92=D1=81=D0=B5=D0=B2=D0=BE=D0=BB=D0=BE=D0=B4=20=D0=93?= =?UTF-8?q?=D1=80=D1=83=D0=B4=D0=B8=D0=BD=D0=B0?= Date: Wed, 16 Jun 2021 10:59:13 +0300 Subject: [PATCH] adds ability to ignore git dependencies --- index.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 0f4f7a9..4f642a5 100755 --- a/index.js +++ b/index.js @@ -9,6 +9,7 @@ const merge = require("lodash/merge") const debounce = require("lodash/debounce") const { spawn } = require("yarn-or-npm") const tar = require("tar") +const yargs = require('yargs'); async function installRelativeDeps() { const projectPkgJson = readPkgUp.sync() @@ -108,13 +109,17 @@ async function libraryHasChanged(name, libDir, targetDir, hashStore) { async function findFiles(libDir, targetDir) { const ignore = ["**/*", "!node_modules", "!.git"] + const { argv: { ignoreGit } } = yargs + .alias('i', 'ignoreGit') + .describe('ignoreGit', 'ignoring git dependencies'); + // TODO: use resolved paths here if (targetDir.indexOf(libDir) === 0) { // The target dir is in the lib directory, make sure that path is excluded ignore.push("!" + targetDir.substr(libDir.length + 1).split(path.sep)[0]) } const files = await globby(ignore, { - gitignore: true, + gitignore: !ignoreGit, cwd: libDir, nodir: true })