Archived
1
0
This repository has been archived on 2024-09-09. You can view files and clone it, but cannot push or open issues or pull requests.
code-server/scripts/nbin-shim.js
2019-07-31 17:22:14 -05:00

17 lines
546 B
JavaScript

// This file is prepended to loader/entry code (like our main.js or VS Code's
// bootstrap-fork.js). {{ROOT_PATH}} is replaced during the build process.
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. */ }
}