Skip to content
This repository has been archived by the owner on Jul 9, 2019. It is now read-only.

Commit

Permalink
[fix:compiler] not all messages are printed
Browse files Browse the repository at this point in the history
This seems to be due to a node issue:
nodejs/node#7743
  • Loading branch information
Manuel Lopez committed Nov 1, 2016
1 parent b501a18 commit 8f79c6d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ function cout(msg: string): void {
}

function exit(code: number): void {
process.exit(code);
// Waiting one second before exiting to finish any ongoing async processes.
// https://github.com/nodejs/node/issues/7743
setTimeout(() => process.exit(code), 1000);
}

function run(cmd: string, callback?: Function): void {
Expand Down
3 changes: 2 additions & 1 deletion src/ts-compile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
IProjectResults,
formatResults,
compileProject,
exit,
} from 'ts-publish';
import * as yargs from 'yargs';

Expand Down Expand Up @@ -47,4 +48,4 @@ function _compile(): number {
return 0;
}

process.exit(_compile());
exit(_compile());
2 changes: 2 additions & 0 deletions src/ts-pre-release.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,15 @@ try {
hook = require(hookPath);
} catch (e) {
cout(`${'[ERROR]'.red} unable to load hook '${hookPath}'\n`);
console.log(e.stack);
}

cout(`${'[HOOK]'.cyan} running...\n`);
try {
hook.hook('pre-release');
} catch (e) {
cout(`${'[ERROR]'.red} hook error:\n'${e.message}'\n`);
console.log(e.stack);
exit(0);
}

Expand Down
2 changes: 2 additions & 0 deletions src/ts-release.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,15 @@ try {
hook = require(hookPath);
} catch (e) {
cout(`${'[ERROR]'.red} unable to load hook '${hookPath}'\n`);
console.log(e.stack);
}

cout(`${'[HOOK]'.cyan} running...\n`);
try {
hook.hook('release');
} catch (e) {
cout(`${'[ERROR]'.red} hook error:\n'${e.message}'\n`);
console.log(e.stack);
exit(0);
}

Expand Down

0 comments on commit 8f79c6d

Please sign in to comment.