Skip to content

Commit

Permalink
Fix issue with process.exit() w. unflushed buffers
Browse files Browse the repository at this point in the history
  • Loading branch information
karlhorky committed Jul 16, 2018
1 parent 3239378 commit 4aa1cf6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
"dependencies": {
"@babel/runtime": "^7.0.0-beta.51",
"chalk": "^2.4.1",
"exit": "^0.1.2",
"findup-sync": "^2.0.0",
"graphql": "^0.13.2",
"hosted-git-info": "^2.6.0",
Expand Down
8 changes: 6 additions & 2 deletions cli/src/__tests__/__snapshots__/e2e.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ exports[`lagu should list all projects 1`] = `
║ ci-node │ ssh://git@192.168.99.1:2222/git/node.git │ true │ true │ ║
╟───────────────────────┼────────────────────────────────────────────────────────┼──────────┼───────────────┼─────────────────────╢
║ ci-rest │ ssh://git@192.168.99.1:2222/git/rest.git │ true │ true │ ║
╚═══════════════════════╧═══════════════�"
╚═══════════════════════╧════════════════════════════════════════════════════════╧══════════╧═══════════════╧═════════════════════╝
"
`;

exports[`lagu should list no environments for a project with none (using --project option) 1`] = `
Expand Down Expand Up @@ -133,7 +134,10 @@ exports[`lagu should list the new project among all projects 1`] = `
║ ci-node │ ssh://git@192.168.99.1:2222/git/node.git │ true │ true │ ║
╟───────────────────────┼────────────────────────────────────────────────────────┼──────────┼───────────────┼─────────────────────╢
║ ci-rest │ ssh://git@192.168.99.1:2222/git/rest.git │ true │ true │ ║
╟───────────────────────┼───────────────�"
╟───────────────────────┼────────────────────────────────────────────────────────┼──────────┼───────────────┼─────────────────────╢
║ e2e-test-project │ ssh://git@192.168.99.1:2222/git/e2e-test-project.git │ true │ true │ ║
╚═══════════════════════╧════════════════════════════════════════════════════════╧══════════╧═══════════════╧═════════════════════╝
"
`;

exports[`lagu should log an error for a non-existent project (using --project option) 1`] = `"No project 'non-existent-project' found."`;
Expand Down
3 changes: 2 additions & 1 deletion cli/src/cli/visit.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// @flow

import exit from 'exit';
import { printErrors } from '../printErrors';

import typeof Yargs from 'yargs';
Expand Down Expand Up @@ -46,6 +47,6 @@ export function visit(cmd: CommandModule) {
process.exit(exitCode);
})
// Process returned with an exit code of typically 0 (success) or 1 (failure)
.then(code => process.exit(code)),
.then(code => exit(code)),
};
}

0 comments on commit 4aa1cf6

Please sign in to comment.