clean up promise handling for ts compilation
This commit is contained in:
12
dist/npmts.compile.js
vendored
12
dist/npmts.compile.js
vendored
@ -28,22 +28,20 @@ var compileTs = function (tsFileArrayArg, tsOptionsArg) {
|
||||
var _loop_1 = function (keyArg) {
|
||||
plugins.beautylog.info("TypeScript assignment: transpile from " + keyArg.blue + " to " + tsFileArrayArg[keyArg].blue);
|
||||
if (helpers.checkOutputPath(tsFileArrayArg, keyArg)) {
|
||||
var filesReadPromise = plugins.smartfile.fs.listFileTree(process.cwd(), keyArg)
|
||||
plugins.smartfile.fs.listFileTree(process.cwd(), keyArg)
|
||||
.then(function (filesToConvertArg) {
|
||||
var filesToConvertAbsolute = plugins.smartpath.transform.toAbsolute(filesToConvertArg, process.cwd());
|
||||
var destDir = plugins.smartpath.transform.toAbsolute(tsFileArrayArg[keyArg], process.cwd());
|
||||
var filesCompiledPromise = plugins.tsn.compile(filesToConvertAbsolute, destDir, compilerOptions(keyArg));
|
||||
promiseArray.push(filesCompiledPromise);
|
||||
return plugins.tsn.compile(filesToConvertAbsolute, destDir, compilerOptions(keyArg));
|
||||
})
|
||||
.then(function () {
|
||||
done.resolve();
|
||||
});
|
||||
promiseArray.push(filesReadPromise);
|
||||
}
|
||||
};
|
||||
for (var keyArg in tsFileArrayArg) {
|
||||
_loop_1(keyArg);
|
||||
}
|
||||
;
|
||||
plugins.Q.all(promiseArray)
|
||||
.then(done.resolve);
|
||||
return done.promise;
|
||||
};
|
||||
exports.run = function (configArg) {
|
||||
|
Reference in New Issue
Block a user