Cordova – update all plugins in project

Written by

in

A quick hack to update all the Cordova plugins used in a Cordova project. Next hack will be updating all Cordova platforms…

From the Cordova project run the following (unix shell required):

cordova plugins | grep -Eo '^[^ ]+' | while read line
do
    echo "cordova plugin remove $line"
    echo "cordova plugin add $line"
done

Comments

4 responses to “Cordova – update all plugins in project”

  1. Ferri Avatar

    So something like cordova plugin update $name doesnt exists? so we really need to remove them first?

    1. admin Avatar
      admin

      To the best of my knowledge, that is the only way – but Cordova has made quite a few releases and improvements since I wrote this entry so they might have improved this as well.

  2. […] Mac OS we can use a semi-automatic solution (solution source) that uses the cordova plugins list command , pipes the output of that command and reads each […]

  3. Tho Vu Avatar
    Tho Vu

    Nice idea… But since some plugins might be dependent on 1 other (e.g. cordova-plugin-media-capture and cordova-plugin-compat), you might not be able to remove the ones that other’re dependent on.

Leave a Reply

Your email address will not be published. Required fields are marked *