yargs-file-commands 0.0.6 → 0.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -22,17 +22,27 @@ export const scanDirectory = async (dirPath, options = {}) => {
22
22
  // Check if path should be ignored
23
23
  const shouldIgnore = ignorePatterns.some((pattern) => pattern.test(dirPath));
24
24
  if (shouldIgnore) {
25
+ if (logLevel === 'debug') {
26
+ console.debug(`Ignoring directory because of ignorePatterns match: ${rootedDirPath}, ${ignorePatterns
27
+ .filter((pattern) => pattern.test(dirPath))
28
+ .join(', ')}`);
29
+ }
25
30
  return [];
26
31
  }
27
32
  try {
28
33
  const entries = await readdir(dirPath);
34
+ if (logLevel === 'debug') {
35
+ console.log(`Found ${entries.length} items in current directory`);
36
+ }
29
37
  const nestedFilesPromises = entries.map(async (entry) => {
30
38
  const fullPath = join(dirPath, entry);
31
39
  // apply ignore pattern and early return if matched
32
40
  const shouldIgnore = ignorePatterns.some((pattern) => pattern.test(entry));
33
41
  if (shouldIgnore) {
34
42
  if (logLevel === 'debug') {
35
- console.debug(`Ignoring file because of ignorePatterns match: ${path.resolve(fullPath)}`);
43
+ console.debug(`Ignoring file because of ignorePatterns match: ${path.resolve(fullPath)}, ${ignorePatterns
44
+ .filter((pattern) => pattern.test(entry))
45
+ .join(', ')}`);
36
46
  }
37
47
  return [];
38
48
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "yargs-file-commands",
3
3
  "description": "A yargs helper function that lets you define your commands structure via directory and file naming conventions.",
4
- "version": "0.0.6",
4
+ "version": "0.0.8",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",