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

process.argv is different when it's defined in config.xml or in hooks/ directory

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Not A Bug
    • None
    • None
    • cordova-cli
    • Cordova Android 4.0.2
      Cordova version: 5.1.1
      Node version: v0.12.2
      MAC OS X 10.9.5
      JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home

    Description

      process.argv is different when it's defined in config.xml or in hooks/ directory.
      process.argv[2] isn't rootdir when is running from config.xml

      When script is put in hooks/before_prepare :

      [ 'node',
        '/PROJECT/hooks/before_prepare/before_prepare_config_edit.js',
        '/PROJECT' ]
      

      When script is declared in config.xml :

      // <hook type="before_prepare" src="hooks/before_prepare_config_edit.js"/>
      [ 'node',
        '/usr/local/bin/cordova',
        'run',
        'android',
        '--release' ]
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            ali_o_kan Laurent Deketelaere
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: