akofman / cordova-plugin-add-swift-support

:hammer: Swiftify your Cordova app !
MIT License
117 stars 110 forks source link

Lib usage #29

Open odra opened 7 years ago

odra commented 7 years ago

Hello,

The plugin hook does not fire when you directly execute it from the cordova-lib cordova.raw.prepare (it only works from the cordova cli - cordova prepare), this change enables the trigger from both cordova cli and cordova-lib.

Do you think this change makes sense?

Regards,

camilamacedo86 commented 7 years ago

@akofman could you check it for us? Can you merge it?

dcousens commented 7 years ago

@odra don't include the npm build, typically the maintainer will do it anyway and its a security issue

odra commented 7 years ago

@dcousens removed :)

akofman commented 7 years ago

Hello @odra, thanks for this PR. As it is described in the comment : This script has to be executed depending on the command line arguments, not on the hook execution cycle.

To be honest I don't remember exactly why but I know that the after_prepare hook is triggered even from other hooks and can implies multiple runs of this script. I think the settings were not well updated in the end.

I'm going to check an other way to do that and keep you in touch. Did you try to check directly cordova.raw.prepare ?

odra commented 7 years ago

Hello @akofman, thanks for the reply.

I do remember this being triggered more than once when using cordova cli but I think this validates to false when directly using cordova.raw.prepare (which is what I am using): context.cmdLine.includes('prepare')

dcousens commented 6 years ago

Rebase or close?

odra commented 6 years ago

@dcousens just rebased it