Archived
1
0

Add ripgrep, fill native fs functions, add ping endpoint (#39)

* Add ripgrep, fill native fs functions, add ping endpoint

* Make show in folder redirect to the workspace
This commit is contained in:
Kyle Carberry
2019-02-27 15:12:26 -06:00
committed by GitHub
parent 3bacbca325
commit 676b30934f
8 changed files with 65 additions and 13 deletions

View File

@ -6,7 +6,7 @@ const path = require("path");
const nexePath = require.resolve("nexe");
const shimPath = path.join(path.dirname(nexePath), "lib/steps/shim.js");
let shimContent = fs.readFileSync(shimPath).toString();
const replaceString = `global.nativeFs = { readdir: originalReaddir, readdirSync: originalReaddirSync };`;
const replaceString = `global.nativeFs = { existsSync: originalExistsSync, readFile: originalReadFile, readFileSync: originalReadFileSync, createReadStream: originalCreateReadStream, readdir: originalReaddir, readdirSync: originalReaddirSync, statSync: originalStatSync, stat: originalStat, realpath: originalRealpath, realpathSync: originalRealpathSync };`;
shimContent = shimContent.replace(/compiler\.options\.resources\.length[\s\S]*wrap\("(.*\\n)"/g, (om, a) => {
return om.replace(a, `${a}${replaceString}`);
});