Fix issue writing too many files asynchronuslly

This commit is contained in:
Mohamed Hegazy 2016-03-10 16:59:56 -08:00
parent 74e6582ffd
commit a75a02cc7b

View File

@ -76,8 +76,11 @@ module Commands {
fs.mkdirSync(directoryPath);
}
}
function normalizeSlashes(path: string): string {
return path.replace(/\\/g, "/");
}
function transalatePath(outputFolder:string, path: string): string {
return outputFolder + directorySeparator + path.replace(":", "");
return normalizeSlashes(outputFolder + directorySeparator + path.replace(":", ""));
}
function fileExists(path: string): boolean {
return fs.existsSync(path);
@ -86,7 +89,7 @@ module Commands {
var filename = transalatePath(outputFolder, f.path);
ensureDirectoriesExist(getDirectoryPath(filename));
console.log("writing filename: " + filename);
fs.writeFile(filename, f.result.contents, (err) => { });
fs.writeFileSync(filename, f.result.contents);
});
console.log("Command: tsc ");