Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-6077

Hooks are not run unless -d flag is used

VotersWatch issueWatchersLinkUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Not A Problem
    • 3.3.0
    • None
    • cordova-cli
    • Xubuntu 13.10 x86_64, node=v0.10.25, npm=1.3.26, cordova=3.3.1-0.4.2

    Description

      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:

      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
      

      From then on, I run

      ./hooks/before_prepare/echo.sh
      

      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:

      Generating config.xml from defaults for platform "android"
      Preparing android project

      The output from cordova -d prepare follows:

      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"

      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!

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            agrieve Andrew Grieve
            kikoalemao Frederico Costa Galv√£o
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Issue deployment