Yawar
Yawar

Reputation: 1943

Cordova Hook should run only if --release is added in build command

I have a Cordova hook that executes after execution of build command. And one hook which executes before build command is executed.

I want it to executes only if --release attribute is added in build command.

Is it possible? As I am doing something in hook (i.e. changing version code of builds.) which I want to do only for release builds.

Please ask if something is unclear to you.

Upvotes: 0

Views: 766

Answers (1)

Gandhi
Gandhi

Reputation: 11935

I wrote a similar hook sometime back but not exactly the same. That was to parameterize the app id to install facebook plugin. You can follow the similar approach to address your issue too.

These links should help you out - SO post on hook and sample hook github repo. May be in your case you gotta set the release attribute as environment variable before every build instead of passing it as an build attribute. Hope it helps.

UPDATE: For mac OS, you can set environmental variables in the user directories .bash_profile

Upvotes: 1

Related Questions