cordova prepare does not call platform prepare hooks
See original GitHub issueIf a prepare hook is defined in a platform block, it is not executed when cordova prepare
is called without specifying a platform.
My expectation is that the platform prepare hooks will be still be called when a platform is not provided as an argument to the platform prepare command.
For example:
Given the following hook:
<platform name="android">
<hook type="after_prepare" src="scripts/androidBeforeBuild.js" />
...
</platform>
When executing the command:
cordova prepare
the hook will not be found or executed.
However when executing the command:
cordova prepare android
the hook will be found and run as expected.
I have observed this for project and plugin hooks.
Is this behaviour by design? My thinking is that it is then always safer to run the platform prepare command with an explicit platform.
Thanks.
Collecting Data...
Node version: v8.10.0
Cordova version: 8.0.0
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Hooks Guide - Apache Cordova
Cordova Hooks represent special scripts which could be added by application and ... cordova run, To be executed before and after preparing your...
Read more >VS2015 Build Not Executing node hooks and no errors
I notice that my hooks are called as expected if I call cordova prepare or cordova build from the command line, but when...
Read more >Cordova Plugin - Hooks not firing - OutSystems
These hooks fire just fine when I build an app using cordova cli, but when I build the native app using Outsystems none...
Read more >Running a Cordova Project in Android Studio - IBM
cordova prepare. This creates the mfpclient.properties file in the assets folder. If this file does not exist, you cannot run your app.
Read more >cordova-uglify - npm
Once you have this hook installed it will compress your apps JavaScript and CSS when you run a cordova prepare <platform> or cordova...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Just encountered this behaviour today myself, while debugging a plugin which ultimately was due to me running
cordova prepare
notcordova prepare ios
and wondering why a hook wasn’t running that the plugin should have run.I would also have expected all the hooks to run, and I don’t see anything in the docs to suggest otherwise, so this seems like it’s probably a bug (although it’s also likely that it has always behaved this way)