1 var fs = require('fs');
2 var path = require('path');
4 var RELEASE_DIR = path.join(__dirname, '..', 'build', 'Release');
6 path.join(RELEASE_DIR, 'conpty.node'),
7 path.join(RELEASE_DIR, 'conpty.pdb'),
8 path.join(RELEASE_DIR, 'conpty_console_list.node'),
9 path.join(RELEASE_DIR, 'conpty_console_list.pdb'),
10 path.join(RELEASE_DIR, 'pty.node'),
11 path.join(RELEASE_DIR, 'pty.pdb'),
12 path.join(RELEASE_DIR, 'winpty-agent.exe'),
13 path.join(RELEASE_DIR, 'winpty-agent.pdb'),
14 path.join(RELEASE_DIR, 'winpty.dll'),
15 path.join(RELEASE_DIR, 'winpty.pdb')
18 cleanFolderRecursive = function(folder) {
20 if( fs.existsSync(folder) ) {
21 files = fs.readdirSync(folder);
22 files.forEach(function(file,index) {
23 var curPath = path.join(folder, file);
24 if(fs.lstatSync(curPath).isDirectory()) { // recurse
25 cleanFolderRecursive(curPath);
26 fs.rmdirSync(curPath);
27 } else if (BUILD_FILES.indexOf(curPath) < 0){ // delete file
28 fs.unlinkSync(curPath);
35 cleanFolderRecursive(RELEASE_DIR);