Archived
1
0

Extract ripgrep when inside binary

This commit is contained in:
Asher
2019-07-16 19:26:05 -05:00
parent db41f106bc
commit 4b0cceb91a
3 changed files with 28 additions and 3 deletions

View File

@ -1,8 +1,17 @@
/* global require, global, process, __dirname */
if (!global.NBIN_LOADED) {
try {
const nbin = require("nbin");
nbin.shimNativeFs("{{ROOT_PATH}}");
global.NBIN_LOADED = true;
const path = require("path");
const rg = require("vscode-ripgrep");
rg.binaryRgPath = rg.rgPath;
rg.rgPath = path.join(
require("os").tmpdir(),
`code-server/${path.basename(rg.binaryRgPath)}`,
);
} catch (error) {
// Not in the binary.
}