Skip to content

Commit

Permalink
Prevent hooks failures in newest cordova versions
Browse files Browse the repository at this point in the history
  • Loading branch information
Vladimir Kotikov committed Oct 23, 2015
1 parent 8a66052 commit 25f1c65
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions hooks/update_config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,19 @@

module.exports = function(context) {

var ConfigParser, XmlHelpers;
try {
ConfigParser = context.requireCordovaModule("cordova-lib/src/configparser/ConfigParser");
XmlHelpers = context.requireCordovaModule("cordova-lib/src/util/xml-helpers");
} catch (e) {
// cordova-lib >= 5.3.4 doesn't contain ConfigParser and xml-helpers anymore
ConfigParser = context.requireCordovaModule("cordova-common").ConfigParser;
XmlHelpers = context.requireCordovaModule("cordova-common").xmlHelpers;
}

/** @external */
var fs = context.requireCordovaModule('fs'),
path = context.requireCordovaModule('path'),
ConfigParser = context.requireCordovaModule("cordova-lib/src/configparser/ConfigParser"),
XmlHelpers = context.requireCordovaModule("cordova-lib/src/util/xml-helpers"),
et = context.requireCordovaModule('elementtree');

/** @defaults */
Expand Down Expand Up @@ -136,4 +144,4 @@ module.exports = function(context) {

xwalkVariables = defaultPreferences();

};
};

0 comments on commit 25f1c65

Please sign in to comment.