You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ag...@apache.org on 2014/03/18 22:25:36 UTC
git commit: Throw an error when a tag is missing `id`
attribute.
Repository: cordova-plugman
Updated Branches:
refs/heads/master f735b57dc -> 97fa482d0
Throw an error when a <dependency> tag is missing `id` attribute.
Project: http://git-wip-us.apache.org/repos/asf/cordova-plugman/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugman/commit/97fa482d
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugman/tree/97fa482d
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugman/diff/97fa482d
Branch: refs/heads/master
Commit: 97fa482d0c403209336b8eb51096cfe6d4df82b6
Parents: f735b57
Author: Andrew Grieve <ag...@chromium.org>
Authored: Tue Mar 18 14:24:58 2014 -0700
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Tue Mar 18 14:25:32 2014 -0700
----------------------------------------------------------------------
src/install.js | 5 +++++
1 file changed, 5 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/97fa482d/src/install.js
----------------------------------------------------------------------
diff --git a/src/install.js b/src/install.js
index 3fea119..cc1b8f0 100644
--- a/src/install.js
+++ b/src/install.js
@@ -2,6 +2,7 @@ var path = require('path'),
fs = require('fs'),
action_stack = require('./util/action-stack'),
dep_graph = require('dep-graph'),
+ elementtree = require('elementtree'),
child_process = require('child_process'),
semver = require('semver'),
config_changes = require('./util/config-changes'),
@@ -338,6 +339,10 @@ function installDependencies(install, dependencies, options) {
dep.subdir = path.join(dep.subdir.split('/'));
}
+ if (!dep.id) {
+ throw new Error('<dependency> tag is missing id attribute: ' + elementtree.tostring(depXml, {xml_declaration:false}));
+ }
+
// We build the dependency graph only to be able to detect cycles, getChain will throw an error if it detects one
options.graph.add(install.top_plugin_id, dep.id);
options.graph.getChain(install.top_plugin_id);