diff --git a/src/ripGrep.ts b/src/ripGrep.ts index e108695..0beea74 100644 --- a/src/ripGrep.ts +++ b/src/ripGrep.ts @@ -2,11 +2,15 @@ import { rgPath } from "@vscode/ripgrep"; import { spawn } from "child_process"; import { once } from "events"; +// TODO: At present, this function is always called recursively in the current directory via process.cwd() +// I might need to add '--max-depth 1' to account for someone nesting sentinel directories +// syntax is 'rg --max-depth 1' + // TODO: At present there's absolutely no point using typescript for this module. // I need to figure out how returning Promise values works when implemented with `spawn` -export async function ripGrep(phrase: string) { +export async function ripGrep(phrase: string, dir: string=process.cwd(), recursiveSearch:boolean=true) { try { - const rg = spawn(rgPath, [phrase, process.cwd()]); + const rg = spawn(rgPath, [phrase, dir]); let exitCode; // Capture ripgrep exit code and return it after the process finishes //exit code for 'no match' is 1 for ripgrep diff --git a/totem-0.0.1.tgz b/totem-0.0.1.tgz deleted file mode 100644 index 9a770e0..0000000 Binary files a/totem-0.0.1.tgz and /dev/null differ