Editing values during build via hooks

Im trying to edit a version variable when I build my applications, but I can’t get any scripts to run using the cordova hooks at all.

I want to get the version from the package.json and the last 5 digits of the git commit so i can have something like 1.0.0.89gkt as my versions.

In the past for ionic 1 and using grunt I was able to add the scripts into the build process easily.

I’ve tried both the old way using the hooks/<hook_name>/script format and using the in the config.xml and neither work for me.

Overwriting the ionic scripts via the package.json allows me to change the scripts that are automatically run, but I want to avoid that if I can. Though I can easily add my text replace to one of the copy scripts or something (ill need to work out which one is best)

If someone knows a better way or a reason as to why the hooks wont fire, please let me know.