From a75a02cc7b206fe4643d518d9903e036d8c172ae Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Thu, 10 Mar 2016 16:59:56 -0800 Subject: [PATCH] Fix issue writing too many files asynchronuslly --- scripts/ior.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/ior.ts b/scripts/ior.ts index f0c142a266c..eb67e62a275 100644 --- a/scripts/ior.ts +++ b/scripts/ior.ts @@ -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 ");