Skip to content

Commit

Permalink
#224: process.exit() was replaced by npm 'exit' package (+return), wh…
Browse files Browse the repository at this point in the history
…ich waits till stdout/stderr buffers are flushed on Windows before exit
  • Loading branch information
yeputons committed Feb 3, 2014
1 parent bafcc9d commit 729ee2a
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 7 deletions.
16 changes: 11 additions & 5 deletions lib/atmosphere.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ var prompt = require('prompt');
var meteoriteArgs = require('optimist').argv;
var version = require('../package').version;
var env = require('../lib/utils/env');
var exit = require('exit');

var writeUserTokenFile = function(user) {
var cfg = {
Expand Down Expand Up @@ -59,7 +60,8 @@ Atmosphere = {
});
}

process.exit(1);
exit(1);
return;
}
meteoriteArgs.verbose && console.log("Published.");
fn();
Expand Down Expand Up @@ -164,7 +166,8 @@ Atmosphere = {
console.log("Please ensure you are running the latest version of Meteorite".red);
console.log(" npm install -g meteorite".red);
console.log("If problems persist, please report here: http://github.com/oortcloud/meteorite/issues".red);
process.exit(1);
exit(1);
return;
}

meteoriteArgs.verbose && console.log("Connected..");
Expand Down Expand Up @@ -203,7 +206,8 @@ Atmosphere = {
}, function (err, input) {
if (err) {
console.log('Error:', err.reason);
process.exit(1);
exit(1);
return;
}

meteoriteArgs.verbose && console.log("Got credentials, logging in..");
Expand All @@ -216,7 +220,8 @@ Atmosphere = {

if (err) {
console.log('Error:', err.reason);
process.exit(1);
exit(1);
return;
}

writeUserTokenFile(user);
Expand Down Expand Up @@ -254,7 +259,8 @@ Atmosphere = {
}], function(err, user) {
if (err) {
console.log('Error:', err.reason);
process.exit(1);
exit(1);
return;
}

meteoriteArgs.verbose && console.log("Logged in.");
Expand Down
4 changes: 3 additions & 1 deletion lib/project.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ var Meteor = require('./meteor');
var Command = require('./command');
var wrench = require('wrench');
var exec = require('child_process').exec;
var exit = require('exit');

// The project is the current directory's personal version of meteor,
// complete with its own set of packages.
Expand Down Expand Up @@ -102,7 +103,8 @@ Project.prototype.fetch = function(fn, forceUpdate) {

if (err) {
console.log(err.message.red);
process.exit(1);
exit(1);
return;
}

fn();
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
, "async": "0.2.9"
, "rolling_timeout_exec": ">=0.0.1"
, "which": ">=1.0.5"
, "exit": ">=0.1.2"
}
, "devDependencies":
{ "mocha": ">=1.2.2"
Expand Down
4 changes: 3 additions & 1 deletion spec/support/bin/git
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ var path = require('path');
var fs = require('../../../lib/utils/fs');
var wrench = require('wrench');
var _ = require('underscore');
var exit = require('exit');

var args = process.argv.slice(2);

Expand All @@ -19,7 +20,8 @@ var copyRepo = function(from, to) {
var REAL_GIT = process.env._METEORITE_REAL_GIT;
if (!REAL_GIT) {
console.error('No _METEORITE_REAL_GIT specified');
process.exit(1);
exit(1);
return;
}

if (command === 'clone') {
Expand Down

0 comments on commit 729ee2a

Please sign in to comment.