csantanapr / grunt-cordovacli

Wraps web app with Cordova CLI using GruntJS
Apache License 2.0
60 stars 31 forks source link

Returns "undefined" when add plugins with --variable parameters #23

Closed jonchenn closed 9 years ago

jonchenn commented 9 years ago

I was trying to add plugins using grunt-cordovacli with the following task:

  add_plugins: {
    options: {
      command: 'plugin',
      action: 'add',
      plugins: [
        'com.phonegap.plugins.facebookconnect --variable APP_ID=\"'+facebookAppId+'\" --variable APP_NAME=\"'+appName+'\"'
      ]
    }        
  }

and it just returns:

Running: ...somepath.../cordova plugin add "com.phonegap.plugins.facebookconnect" --variable APP_ID="xxxxxxx" --variable APP_NAME="xxxxxx" undefined Error Error-> with Series tasksError

danlbob commented 9 years ago

Having this issue as well. Any workarounds?

csantanapr commented 9 years ago

Use the args property to pass variables

add_facebook_plugin: {
        options: {
            command: 'plugin',
            action: 'add',  
            plugins: [                 
                'com.phonegap.plugins.facebookconnect'
            ],
            args:['--variable','APP_ID=fb12132424','--variable','APP_NAME=myappname']
        }
    }