mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Work around a cordova bug
Fixes #3914. Fixes self-test 'add cordova plugins'.
This commit is contained in:
@@ -482,6 +482,12 @@ var installPlugin = function (cordovaPath, name, version, conf) {
|
||||
{ cwd: cordovaPath, env: buildCordovaEnv() });
|
||||
if (! execRes.success)
|
||||
throw new Error("Failed to install plugin " + name + ": " + execRes.stderr);
|
||||
// Starting with cordova-lib 4.0.0, `plugin add` fails to exit non-zero on
|
||||
// this particular error, and it prints the error on stdout. See
|
||||
// https://github.com/meteor/meteor/issues/3914
|
||||
if (execRes.stdout.match(/Variable\(s\) missing/)) {
|
||||
throw new Error("Failed to install plugin " + name + ": " + execRes.stdout);
|
||||
}
|
||||
|
||||
if (utils.isUrlWithSha(version)) {
|
||||
var lock = getTarballPluginsLock(cordovaPath);
|
||||
|
||||
2
tools/tests/cordova-plugins.js
vendored
2
tools/tests/cordova-plugins.js
vendored
@@ -171,10 +171,12 @@ selftest.define("add cordova plugins", ["slow", "cordova"], function () {
|
||||
run = s.run("add", "cordova:foo@1.0.0");
|
||||
run.waitSecs(5);
|
||||
run.match("added cordova plugin foo");
|
||||
run.expectExit(0);
|
||||
|
||||
run = s.run("remove", "cordova:foo");
|
||||
run.waitSecs(5);
|
||||
run.match("removed cordova plugin foo");
|
||||
run.expectExit(0);
|
||||
|
||||
checkUserPlugins(s, ["org.apache.cordova.camera"]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user