csantanapr / grunt-cordovacli

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

Unable to remove plugins #20

Closed pfremm closed 9 years ago

pfremm commented 9 years ago

Unable to remove a plugin with the grunt task. Line 237 hardcodes option.action to add.

csantanapr commented 9 years ago

Line 237 is only for full cycle. where options.command is an array only add can be done for platforms and plugins. To remove a plugin, this can only be done with options.command being a string 'rm' or 'remove' and options.plugin a shortcut 'camera' or ID 'org.apache.cordova.battery-status'

Create a separate subtask like this:

remove_plugin: {
        options: {
            command: 'plugin',
            action: 'rm',
            plugins: [
                'battery-status'
            ]
        }
    }

Then you call the task grunt cordovacli:remove_plugin

I will update the README to make this clear. Thanks for the report :+1: