I created an after_prepare
hook :
#!/usr/bin/env node
module.exports = function(context) {
... some code
console.log('Hey, a hook');
}
When I run cordova build android
, I see in the terminal that it says it is running my hook but it seems like it's not running the module.exports function, because the console.log isn't shown in the console.
I solved this!
I added hook to the config.xml file
<hook type="after_prepare" src="hooks/after_prepare/020_add_android_permissions.js"/>
and now it executes the code under the module.exports
function.
Update: here is the working example
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With