Github user feichngr commented on a diff in the pull request: https://github.com/apache/cordova-lib/pull/549#discussion_r113615881 --- Diff: cordova-lib/src/hooks/HooksRunner.js --- @@ -178,7 +178,9 @@ function runScriptViaModuleLoader(script, context) { } var scriptFn = require(script.fullPath); context.scriptLocation = script.fullPath; - context.opts.plugin = script.plugin; + if(script.plugin) { + context.opts.plugin = script.plugin; --- End diff -- Yes and no. cordova-lib/src/plugman/install.js already populates `opts.plugin` before it is passed to `HooksRunner`. What currently happens in this code snippet is that the field is overridden with either information on the plugin which provides the script (i.e. the on in which `plugin.xml` it is defined) or `undefined` if the script is part of the project (i.e. defined in config.xml) because `script.plugin` is `undefined`. My change just prevents the override in the later case. The first case should behave as before so it doesn't break existing scripts.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org