Skip to content

Commit

Permalink
Fix for windows build process
Browse files Browse the repository at this point in the history
  • Loading branch information
hazinstore committed Oct 24, 2016
1 parent f976ae8 commit 7b9c3db
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions clean.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/**
* Part of the build script because windows doesn't have rm -rf and npm doesn't have conditionals
*/
const exec = require('child_process').exec;
const os = require('os');
function done(error, stdout, stderr) {
if (error) {
console.error(`exec error: ${error}`);
return;
}
console.log(`stdout: ${stdout}`);
console.log(`stderr: ${stderr}`);
console.log("All done cleaning dist");
}

if(os.platform() == "win32"){
exec("if exist \"dist\" rd /S/Q dist",done);
}else{
exec("rm -rf ./dist/*",done);
}

0 comments on commit 7b9c3db

Please sign in to comment.