Skip to content

Commit 8339887

Browse files
Remove call to npx node-gyp in postinstall script
1 parent d738123 commit 8339887

File tree

1 file changed

+11
-19
lines changed

1 file changed

+11
-19
lines changed

scripts/post-install.js

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
//@ts-check
2-
3-
const { execSync } = require('child_process');
41
const fs = require('fs');
52
const os = require('os');
63
const path = require('path');
@@ -25,25 +22,25 @@ const CONPTY_SUPPORTED_ARCH = ['x64', 'arm64'];
2522
console.log('\x1b[32m> Cleaning release folder...\x1b[0m');
2623

2724
function cleanFolderRecursive(folder) {
28-
var files = [];
25+
let files = [];
2926
if (fs.existsSync(folder)) {
3027
files = fs.readdirSync(folder);
31-
files.forEach(function(file,index) {
32-
var curPath = path.join(folder, file);
33-
if (fs.lstatSync(curPath).isDirectory()) { // recurse
34-
cleanFolderRecursive(curPath);
35-
fs.rmdirSync(curPath);
36-
} else if (BUILD_FILES.indexOf(curPath) < 0){ // delete file
37-
fs.unlinkSync(curPath);
28+
for (let file of files) {
29+
let currentPath = path.join(folder, file);
30+
if (fs.lstatSync(currentPath).isDirectory()) {
31+
cleanFolderRecursive(currentPath);
32+
fs.rmdirSync(currentPath);
33+
} else if (!BUILD_FILES.includes(currentPath)) {
34+
fs.unlinkSync(currentPath);
3835
}
39-
});
36+
}
4037
}
4138
};
4239

4340
try {
4441
cleanFolderRecursive(RELEASE_DIR);
45-
} catch(e) {
46-
console.log(e);
42+
} catch (err) {
43+
console.error(err);
4744
process.exit(1);
4845
}
4946

@@ -76,8 +73,3 @@ if (os.platform() !== 'win32') {
7673
}
7774
}
7875
}
79-
80-
console.log(`\x1b[32m> Generating compile_commands.json...\x1b[0m`);
81-
execSync('npx node-gyp configure -- -f compile_commands_json');
82-
83-
process.exit(0);

0 commit comments

Comments
 (0)