[ 
https://issues.apache.org/jira/browse/CB-6077?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13906543#comment-13906543
 ] 

Frederico Costa Galvão commented on CB-6077:
--------------------------------------------

While testing a real hook I was trying to write earlier today (a script that 
copies files, and writes stuff), at some point I saw that the script was really 
not being executed at all, but I didn't make a test for that specificaly, and 
unfortunately can't do it right now. I'll do it tomorrow and let you know.

> Hooks are not run unless -d flag is used
> ----------------------------------------
>
>                 Key: CB-6077
>                 URL: https://issues.apache.org/jira/browse/CB-6077
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: CLI
>    Affects Versions: 3.3.0
>         Environment: Xubuntu 13.10 x86_64, node=v0.10.25, npm=1.3.26, 
> cordova=3.3.1-0.4.2
>            Reporter: Frederico Costa Galvão
>            Assignee: Andrew Grieve
>              Labels: cli, hooks
>
> Hooks aren't touched, and therefore aren't executed, if I run "cordova 
> <action>" without the "-d" flag.
> I've tested in a ultra simple scenario:
> {code:none}
> cordova create foo com.foo Foo
> cd foo/
> mkdir -p hooks/before_prepare
> echo -e '#!/bin/bash\necho "foo"' > hooks/before_prepare/echo.sh
> chmod +x hooks/before_prepare/echo.sh
> cordova platform add android
> {code}
> From then on, I run
> {code:none}
> ./hooks/before_prepare/echo.sh
> {code}
> to make sure the script works, and it really does.
> Now, none of ["cordova prepare", "cordova build", "cordova run"] causes the 
> *echo* hook to be executed. However, if I specify the verbose flag *-d* to 
> any of those, the hook is finally executed.
> A couple of weeks ago, max, I was making tests the same way I'm doing now 
> with cordova, and I kinda remember that it somehow worked as expected, 
> although I don't remember any changes in my environment such as node, npm, or 
> cordova version that could've changed something like this.
> The output from *cordova prepare* follows:
> {quote}
> Generating config.xml from defaults for platform "android"
> Preparing android project
> {quote}
> The output from *cordova -d prepare* follows:
> {quote}
> Executing hook ""<localpath>/foo/hooks/before_prepare/echo.sh" 
> "<localpath>/foo""
> foo
>  
> cordova library for "android" already exists. No need to download. Continuing.
> Generating config.xml from defaults for platform "android"
> Calling plugman.prepare for platform "android"
> Preparing android project
> Processing configuration changes for plugins.
> Iterating over installed plugins: []
> Writing out cordova_plugins.js...
> Wrote out Android application name to "Foo"
> Wrote out Android package name to "com.foo"
> {quote}
> PS: At first I wish I could've found this before you had released 3.4, but 
> I'm happy that the cli have a independent release cycle now!



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Reply via email to