Skip to content

Commit

Permalink
fix: use bundled rg binary (from VS code application)
Browse files Browse the repository at this point in the history
  • Loading branch information
ggrossetie committed Oct 12, 2024
1 parent ad8af57 commit b1ab3b7
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 22 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
5 changes: 3 additions & 2 deletions 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 { spawn } from 'node:child_process'
import ospath from 'node: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 b1ab3b7

Please sign in to comment.