fluxflow-cli 1.18.21 → 1.18.23
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.
- package/dist/fluxflow.js +22 -16
- package/package.json +1 -1
package/dist/fluxflow.js
CHANGED
|
@@ -4300,6 +4300,7 @@ var init_search_keyword = __esm({
|
|
|
4300
4300
|
if (!keyword) return 'ERROR: Missing "keyword" argument.';
|
|
4301
4301
|
const isWindows = process.platform === "win32";
|
|
4302
4302
|
const excludes = ["node_modules", ".git", "dist", ".next", ".gemini"];
|
|
4303
|
+
const currentFolder = path13.basename(process.cwd());
|
|
4303
4304
|
let command = "";
|
|
4304
4305
|
if (file) {
|
|
4305
4306
|
if (isWindows) {
|
|
@@ -4310,7 +4311,7 @@ var init_search_keyword = __esm({
|
|
|
4310
4311
|
} else {
|
|
4311
4312
|
if (isWindows) {
|
|
4312
4313
|
const excludePattern = excludes.join("|").replace(/\./g, "\\.");
|
|
4313
|
-
command = `powershell -NoProfile -Command "Get-ChildItem -Path . -Recurse -File -ErrorAction SilentlyContinue | Where-Object { $_.FullName -notmatch '${excludePattern}' } | Select-String -Pattern '${keyword}' -ErrorAction SilentlyContinue | Select-Object -First 150 | ForEach-Object { '{0}|{1}' -f $_.Path, $_.LineNumber }"`;
|
|
4314
|
+
command = `powershell -NoProfile -Command "Get-ChildItem -Path . -Recurse -File -ErrorAction SilentlyContinue | Where-Object { $_.FullName -notmatch '${currentFolder}.*\\\\(${excludePattern})' } | Select-String -Pattern '${keyword}' -ErrorAction SilentlyContinue | Select-Object -First 150 | ForEach-Object { '{0}|{1}' -f $_.Path, $_.LineNumber }"`;
|
|
4314
4315
|
} else {
|
|
4315
4316
|
const excludeDirArgs = excludes.map((d) => `--exclude-dir="${d}"`).join(" ");
|
|
4316
4317
|
command = `grep -rnI ${excludeDirArgs} "${keyword}" . | head -n 150`;
|
|
@@ -4329,23 +4330,18 @@ var init_search_keyword = __esm({
|
|
|
4329
4330
|
}
|
|
4330
4331
|
const rawLines = stdout.trim().split("\n").filter((l) => l.trim() !== "");
|
|
4331
4332
|
if (rawLines.length === 0) return resolve(`Found 0 matches for keyword: "${keyword}"${file ? ` in file: ${file}` : ""}`);
|
|
4332
|
-
const
|
|
4333
|
-
|
|
4334
|
-
return !lower.includes("node_modules") && !lower.includes(".git") && !lower.includes("dist") && !lower.includes(".next") && !lower.includes(".gemini");
|
|
4335
|
-
});
|
|
4336
|
-
if (filteredLines.length === 0) return resolve(`Found 0 matches for keyword: "${keyword}"${file ? ` in file: ${file}` : ""}`);
|
|
4337
|
-
const matches = filteredLines.slice(0, 150).map((line) => {
|
|
4333
|
+
const matches = rawLines.slice(0, 150).map((line) => {
|
|
4334
|
+
let filePath, lineNum;
|
|
4338
4335
|
if (line.includes("|")) {
|
|
4339
4336
|
const parts = line.split("|");
|
|
4340
4337
|
let rawPath = parts[0];
|
|
4341
4338
|
if (path13.isAbsolute(rawPath)) {
|
|
4342
4339
|
rawPath = path13.relative(process.cwd(), rawPath);
|
|
4343
4340
|
}
|
|
4344
|
-
|
|
4345
|
-
|
|
4346
|
-
return `${filePath} ${lineNum}`;
|
|
4341
|
+
filePath = rawPath.replace(/^(\.\/|\.\\)/, "").replace(/\\/g, "/");
|
|
4342
|
+
lineNum = parts[1];
|
|
4347
4343
|
} else {
|
|
4348
|
-
let rawPath
|
|
4344
|
+
let rawPath;
|
|
4349
4345
|
const driveMatch = line.match(/^([a-zA-Z]:)/);
|
|
4350
4346
|
if (driveMatch) {
|
|
4351
4347
|
const startSearch = 2;
|
|
@@ -4367,15 +4363,25 @@ var init_search_keyword = __esm({
|
|
|
4367
4363
|
if (path13.isAbsolute(rawPath)) {
|
|
4368
4364
|
rawPath = path13.relative(process.cwd(), rawPath);
|
|
4369
4365
|
}
|
|
4370
|
-
|
|
4371
|
-
|
|
4372
|
-
}
|
|
4366
|
+
filePath = rawPath.replace(/^(\.\/|\.\\)/, "").replace(/\\/g, "/");
|
|
4367
|
+
lineNum = lineNum;
|
|
4368
|
+
}
|
|
4369
|
+
if (!filePath || !lineNum) return null;
|
|
4370
|
+
const absoluteFilePath = path13.resolve(process.cwd(), filePath).toLowerCase().replace(/\\/g, "/");
|
|
4371
|
+
const pathSegments = absoluteFilePath.split("/");
|
|
4372
|
+
const currentFolderLower = currentFolder.toLowerCase();
|
|
4373
|
+
const folderIndex = pathSegments.lastIndexOf(currentFolderLower);
|
|
4374
|
+
const relativeSegments = folderIndex !== -1 ? pathSegments.slice(folderIndex + 1) : pathSegments;
|
|
4375
|
+
const isNoise = excludes.some((ex) => relativeSegments.includes(ex.toLowerCase()));
|
|
4376
|
+
if (isNoise) return null;
|
|
4377
|
+
return `${filePath} ${lineNum}`;
|
|
4373
4378
|
}).filter(Boolean);
|
|
4374
|
-
|
|
4379
|
+
if (matches.length === 0) return resolve(`Found 0 matches for keyword: "${keyword}"${file ? ` in file: ${file}` : ""}`);
|
|
4380
|
+
let output = `Found ${matches.length} matches:
|
|
4375
4381
|
|
|
4376
4382
|
`;
|
|
4377
4383
|
output += matches.join("\n");
|
|
4378
|
-
if (
|
|
4384
|
+
if (matches.length >= 150) {
|
|
4379
4385
|
output += "\n\n... (Truncated to first 150 matches)";
|
|
4380
4386
|
}
|
|
4381
4387
|
resolve(output);
|