diff --git a/package.json b/package.json index 84d254c..180c296 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ }, "dependencies": { "colors": "^1.1.2", - "fs-extra": "^2.0.0", + "fs-extra": "^2.1.2", "graphlib": "^2.1.1", "lodash": "^4.17.4", "object-hash": "^1.1.5", diff --git a/src/index.ts b/src/index.ts index 5df4c91..d6205db 100644 --- a/src/index.ts +++ b/src/index.ts @@ -226,7 +226,9 @@ export default function typescript (options: IOptions) printDiagnostics(contextWrapper, diagnostics); // since no output was generated, aborting compilation - this.error(colors.red(`failed to transpile '${id}'`)); + cache.done(); + if (_.isFunction(this.error)) + this.error(colors.red(`failed to transpile '${id}'`)); } const transpiled = _.find(output.outputFiles, (entry) => _.endsWith(entry.name, ".js") ); @@ -286,19 +288,13 @@ export default function typescript (options: IOptions) convertDiagnostic("semantic", service.getSemanticDiagnostics(id)), ); - if (diagnostics.length > 0) - noErrors = false; - printDiagnostics(context, diagnostics); }); - - if (!noErrors) - { - noErrors = true; - context.info(colors.yellow("there were errors or warnings above.")); - } } + if (!watchMode && !noErrors) + context.info(colors.yellow("there were errors or warnings above.")); + cache.done(); round++; diff --git a/src/rollingcache.ts b/src/rollingcache.ts index d2e2901..69f569b 100644 --- a/src/rollingcache.ts +++ b/src/rollingcache.ts @@ -100,6 +100,6 @@ export class RollingCache implements ICache this.rolled = true; fs.removeSync(this.oldCacheRoot); - fs.move(this.newCacheRoot, this.oldCacheRoot, () => { ; }); + fs.renameSync(this.newCacheRoot, this.oldCacheRoot); } }