cordova-plugin-app-version icon indicating copy to clipboard operation
cordova-plugin-app-version copied to clipboard

add missing attribute for js-module tag

Open denisbabineau opened this issue 9 years ago • 1 comments

was causing obscure bug during installation with older version of nodejs, as is the case when using meteor (uses its own version of node currently at v0.10.41 where the 'path' package doesn't have the 'parse' method (see error below):

=> Errors executing Cordova commands:

While adding plugin [email protected] to Cordova project: TypeError: Uh oh! Object [object Object] has no method 'parse' at handlers.js-module.install (//.meteor/local/cordova-build/platforms/android/cordova/lib/pluginHandlers.js:142:66)

and the culprit code (last line falls back to parsing the src attribute for a name if name is not defined):

'js-module': {
    install: function (obj, plugin, project, options) {
        // Copy the plugin's files into the www directory.
        var moduleSource = path.resolve(plugin.dir, obj.src);
        var moduleName = plugin.id + '.' + (obj.name || path.parse(obj.src).name);

Defining the name attribute just avoids this mess :-)

denisbabineau avatar Feb 25 '16 19:02 denisbabineau

This looks good to me, I'll need to test and there are a few open PR's at the moment that I may merge up together for an update, this will likely go on that branch...

DennisSmolek avatar Jun 27 '18 12:06 DennisSmolek