com.wallstop-studios.dxmessaging 2.1.3 → 2.1.4

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.
@@ -7,7 +7,10 @@ const fs = require('fs');
7
7
  const path = require('path');
8
8
 
9
9
  const repoRoot = process.cwd();
10
- const verbose = process.argv.includes('-v') || process.argv.includes('--verbose');
10
+ const argv = process.argv.slice(2);
11
+ const verbose = argv.includes('-v') || argv.includes('--verbose');
12
+ const flagArgs = new Set(['-v', '--verbose']);
13
+ const targetArgs = argv.filter((arg) => !flagArgs.has(arg));
11
14
 
12
15
  // Exclude directory patterns (match anywhere in path)
13
16
  const excludeRegexes = [
@@ -63,7 +66,40 @@ function toCrlf(txt) {
63
66
  return normalized.replace(/\n/g, '\r\n');
64
67
  }
65
68
 
66
- const allFiles = walk(repoRoot);
69
+ function resolveTargets(targets) {
70
+ if (targets.length === 0) {
71
+ return walk(repoRoot);
72
+ }
73
+
74
+ const seen = new Set();
75
+ const resolvedFiles = [];
76
+
77
+ for (const rawTarget of targets) {
78
+ const targetPath = path.resolve(repoRoot, rawTarget);
79
+ if (!fs.existsSync(targetPath)) {
80
+ continue;
81
+ }
82
+
83
+ const stats = fs.statSync(targetPath);
84
+ if (stats.isDirectory()) {
85
+ for (const file of walk(targetPath)) {
86
+ if (!seen.has(file)) {
87
+ resolvedFiles.push(file);
88
+ seen.add(file);
89
+ }
90
+ }
91
+ } else if (stats.isFile()) {
92
+ if (!seen.has(targetPath)) {
93
+ resolvedFiles.push(targetPath);
94
+ seen.add(targetPath);
95
+ }
96
+ }
97
+ }
98
+
99
+ return resolvedFiles;
100
+ }
101
+
102
+ const allFiles = resolveTargets(targetArgs);
67
103
  let changed = 0;
68
104
  let scanned = 0;
69
105
 
@@ -94,4 +130,3 @@ console.log(`Scanned ${scanned} text files. Updated ${changed}.`);
94
130
  if (changed > 0) {
95
131
  console.log('All changes written with CRLF and no BOM.');
96
132
  }
97
-