Skip to content

Commit

Permalink
fix: use bundled rg binary (from VS code application) (#914)
Browse files Browse the repository at this point in the history
  • Loading branch information
ggrossetie authored Oct 12, 2024
1 parent ad8af57 commit 2f9212e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 21 deletions.
29 changes: 10 additions & 19 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,6 @@
"@asciidoctor/core": "2.2.7",
"@asciidoctor/docbook-converter": "2.0.0",
"@orcid/bibtex-parse-js": "0.0.25",
"@vscode/ripgrep": "1.15.9",
"asciidoctor-kroki": "0.18.1",
"html-entities": "^2.4.0",
"js-yaml": "^4.1.0",
Expand Down
3 changes: 2 additions & 1 deletion src/util/findFiles.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { spawn } from 'child_process'
import { rgPath } from '@vscode/ripgrep'
import ospath from 'path'
import vscode, { Uri } from 'vscode'
import { getWorkspaceFolders } from './workspace'

Expand All @@ -22,6 +22,7 @@ export async function findFiles (glob: string): Promise<Uri[]> {
}

async function ripgrep (glob: string, rootFolder: string): Promise<string[]> {
const rgPath = ospath.join(vscode.env.appRoot, `node_modules/@vscode/ripgrep/bin/rg${process.platform === 'win32' ? '.exe' : ''}`)
return new Promise((resolve, reject) => {
const rg = spawn(rgPath, ['--hidden', '--follow', '--files', '-g', glob], { cwd: rootFolder })
let stdout : string = ''
Expand Down

0 comments on commit 2f9212e

Please sign in to comment.