mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Merge pull request #6675 from abernix/fix-dev-bundle-bin-command-exit-status
"meteor npm/node" should return exit code from command
This commit is contained in:
@@ -1,4 +1,18 @@
|
||||
if (! require("./cli/dev-bundle-bin-commands.js").process) {
|
||||
var spawnBinProcess = require('./cli/dev-bundle-bin-commands.js').process
|
||||
if (spawnBinProcess) {
|
||||
// On Node 0.10 on Windows, stdout and stderr don't get flushed when calling
|
||||
// `process.exit`. We use a workaround for now, but this should be fixed on
|
||||
// Node 0.12, so when we upgrade let's remember to remove this clause, and the
|
||||
// file it requires. See https://github.com/joyent/node/issues/3584
|
||||
// This same comment and require is in ./cli/main.js
|
||||
if (process.platform === 'win32') {
|
||||
require('./tool-env/flush-buffers-on-exit-in-windows.js');
|
||||
}
|
||||
|
||||
spawnBinProcess.on('exit', function (exitCode) {
|
||||
process.exit(exitCode);
|
||||
});
|
||||
} else {
|
||||
// Set up the Babel transpiler
|
||||
require('./tool-env/install-babel.js');
|
||||
|
||||
|
||||
1
tools/tests/apps/dev-bundle-bin-commands/.meteor/.gitignore
vendored
Normal file
1
tools/tests/apps/dev-bundle-bin-commands/.meteor/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
local
|
||||
@@ -0,0 +1,8 @@
|
||||
# Meteor packages used by this project, one per line.
|
||||
# Check this file (and the other files in this directory) into your repository.
|
||||
#
|
||||
# 'meteor add' and 'meteor remove' will edit this file for you,
|
||||
# but you can also edit it by hand.
|
||||
|
||||
meteor-base # Packages every Meteor app needs to have
|
||||
ecmascript
|
||||
1
tools/tests/apps/dev-bundle-bin-commands/.meteor/release
Normal file
1
tools/tests/apps/dev-bundle-bin-commands/.meteor/release
Normal file
@@ -0,0 +1 @@
|
||||
none
|
||||
12
tools/tests/apps/dev-bundle-bin-commands/package.json
Normal file
12
tools/tests/apps/dev-bundle-bin-commands/package.json
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"name": "dev-bundle-bin-commands",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"start": "meteor run",
|
||||
"exit-with-status": "echo \"This script has an exit status\" && exit 1",
|
||||
"exit-normally": "echo \"This script will exit normally\" && exit 0"
|
||||
},
|
||||
"dependencies": {
|
||||
"meteor-node-stubs": "~0.2.0"
|
||||
}
|
||||
}
|
||||
24
tools/tests/dev-bundle-bin-commands.js
Normal file
24
tools/tests/dev-bundle-bin-commands.js
Normal file
@@ -0,0 +1,24 @@
|
||||
var selftest = require('../tool-testing/selftest.js');
|
||||
var Sandbox = selftest.Sandbox;
|
||||
|
||||
selftest.define("meteor npm run some-script-name - error returns exit status to shell", function () {
|
||||
var s = new Sandbox();
|
||||
var run;
|
||||
|
||||
s.createApp("myapp", "dev-bundle-bin-commands");
|
||||
s.cd("myapp");
|
||||
run = s.run("npm", "run", "exit-with-status");
|
||||
run.matchErr("This script has an exit status");
|
||||
run.expectExit(1);
|
||||
});
|
||||
|
||||
selftest.define("meteor npm some-script-name - normal exit returns normal to shell", function () {
|
||||
var s = new Sandbox();
|
||||
var run;
|
||||
|
||||
s.createApp("myapp", "dev-bundle-bin-commands");
|
||||
s.cd("myapp");
|
||||
run = s.run("npm", "run", "exit-normally");
|
||||
run.match("This script will exit normally");
|
||||
run.expectExit(0);
|
||||
});
|
||||
Reference in New Issue
Block a user