1
0
mirror of https://github.com/coder/code-server.git synced 2024-12-05 07:13:06 +08:00
code-server/scripts/nbin-shim.js
2019-07-19 17:43:54 -05:00

15 lines
393 B
JavaScript

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. */ }
}