Comparing version
@@ -20,2 +20,4 @@ const chalk = require('chalk'); | ||
options.excludeOnly = options.excludeOnly || getArgsForFlag(process.argv, '--exclude-only') || looprc.excludeOnly; | ||
options.excludePattern = | ||
options.excludePattern || getArgsForFlag(process.argv, '--exclude-pattern') || looprc.excludePattern; | ||
options.exitOnAggregateError = | ||
@@ -26,2 +28,4 @@ options.exitOnAggregateError || getArgsForFlag(process.argv, '--exit-on-aggregate-error'); | ||
options.includeOnly = options.includeOnly || getArgsForFlag(process.argv, '--include-only') || looprc.includeOnly; | ||
options.includePattern = | ||
options.includePattern || getArgsForFlag(process.argv, '--include-pattern') || looprc.includePattern; | ||
options.parallel = options.parallel || getFlag(process.argv, '--parallel') || looprc.parallel; | ||
@@ -36,2 +40,7 @@ debug(`executing ${util.inspect(options)} ${process.argv}`); | ||
}); | ||
} else if (options.excludePattern) { | ||
const regexp = new RegExp(options.excludePattern); | ||
dirs = dirs.filter(dir => { | ||
return !regexp.test(path.relative(cwd, dir)); | ||
}); | ||
} | ||
@@ -48,2 +57,7 @@ | ||
).sort(); | ||
} else if (options.includePattern) { | ||
const regexp = new RegExp(options.includePattern); | ||
dirs = dirs.filter(dir => { | ||
return regexp.test(path.relative(cwd, dir)); | ||
}); | ||
} | ||
@@ -50,0 +64,0 @@ |
{ | ||
"name": "loop", | ||
"version": "3.3.2", | ||
"version": "3.3.3", | ||
"description": "loop through commands in fun and amazing ways!", | ||
@@ -42,3 +42,3 @@ "main": "./index.js", | ||
"should": "^13.2.3", | ||
"yargs": "^13.0.0" | ||
"yargs": "^14.0.0" | ||
}, | ||
@@ -53,6 +53,9 @@ "devDependencies": { | ||
"jest": "24.8.0", | ||
"mkdirp": "0.5.1", | ||
"mocha": "6.1.4", | ||
"prettier": "1.18.2", | ||
"pretty-quick": "1.11.1" | ||
"pretty-quick": "1.11.1", | ||
"tmp": "0.1.0", | ||
"which": "1.3.1" | ||
} | ||
} |
@@ -16,4 +16,6 @@ # loop | ||
loop --include-only comma,delimited,list,of,dirs - execute a command against all child dirs, ignoring .looprc, and only including the specified directories | ||
loop --include-pattern 'regexp' - execute a command against all child dirs that match the regular expression | ||
loop --exclude comma,delimited,list,of,dirs - execute a command against all child dirs, excluding the specified directories | ||
loop --exclude-only comma,delimited,list,of,dirs - execute a command against all child dirs, excluding only the specified directories | ||
loop --exclude-pattern 'regexp' - execute a command against all child dirs, excluding directories that match the regular expression | ||
loop --init - creates a .looprc in the current working directory | ||
@@ -20,0 +22,0 @@ |
Sorry, the diff of this file is not supported yet
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
25668
25.09%27
3.85%329
55.19%190
1.06%13
30%1
Infinity%+ Added
+ Added
- Removed
- Removed
Updated