Skip to content

Commit 31518e9

Browse files
committed
Make ripgrep executable on extract
1 parent 1e0d330 commit 31518e9

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

packages/server/src/modules.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,15 @@ export const setup = (dataDirectory: string): void => {
2222
return currentDir;
2323
}, os.platform() === "win32" ? undefined! : path.sep); // Might need path.sep here for linux. Having it for windows causes an error because \C:\Users ...
2424

25-
const unpackModule = (moduleName: string): void => {
25+
const unpackModule = (moduleName: string, markExecutable: boolean = false): void => {
2626
const memFile = path.join(isCli ? buildDir! : path.join(__dirname, ".."), "build/dependencies", moduleName);
2727
const diskFile = path.join(dataDirectory, "dependencies", moduleName);
2828
if (!fs.existsSync(diskFile)) {
2929
fs.writeFileSync(diskFile, fs.readFileSync(memFile));
30+
31+
if (markExecutable) {
32+
fs.chmodSync(diskFile, "755");
33+
}
3034
}
3135
};
3236

@@ -37,7 +41,7 @@ export const setup = (dataDirectory: string): void => {
3741
*/
3842
unpackModule("pty.node");
3943
unpackModule("spdlog.node");
40-
unpackModule("rg");
44+
unpackModule("rg", true);
4145
// const nodePtyUtils = require("../../protocol/node_modules/node-pty-prebuilt/lib/utils") as typeof import("../../protocol/node_modules/node-pty-prebuilt/src/utils");
4246
// tslint:disable-next-line:no-any
4347
// nodePtyUtils.loadNative = (modName: string): any => {

0 commit comments

Comments
 (0)