Nit: could we call it 'upgrade' not 'update' ? I realize that you are matching the name of the bin/ script, but I don't think that anyone was using that, and 'update' usually only fetches metadata while 'upgrade' does what you describe in other package management type tools.
On Tue, Sep 10, 2013 at 1:46 PM, Anis KADRI <[email protected]> wrote: > YES! I've been wanting something like this since 2.4 :-) > > On Tue, Sep 10, 2013 at 12:37 PM, Andrew Grieve <[email protected]> > wrote: > > Made tasks for this on JIRA: > https://issues.apache.org/jira/browse/CB-4776 > > > > Feel free to continue discussing here. > > > > > > On Tue, Sep 10, 2013 at 1:48 PM, Michael Brooks < > [email protected]>wrote: > > > >> Effectively, this could also be used to downgrade a project because it's > >> updating the project to match the globally installed Cordova version. > >> > >> Looks good though! It's important to keep the upgrade responsibility > within > >> the platform scripts. > >> > >> Michael > >> > >> > >> On Tue, Sep 10, 2013 at 8:30 AM, Andrew Grieve <[email protected]> > >> wrote: > >> > >> > Our upgrade process from 2.9 -> 3.0 was to recreate a project and copy > >> your > >> > files over. It would be sad if these were our instructions for 3.0 -> > >> 3.1. > >> > > >> > What I'd like to see: > >> > > >> > $ cd MyProject > >> > $ cordova --version > >> > 3.0.9 > >> > $ npm update -g cordova > >> > $ cordova --version > >> > 3.1.0-1.0.0 > >> > $ cordova platform ls > >> > Installed platforms: > >> > android 3.0.0 > >> > ios 3.0.0 > >> > Available platforms: > >> > android 3.1.0 > >> > ios 3.1.0 > >> > blackberry10 3.1.0 > >> > $ cordova platform add android > >> > Platform android already exists. Use `update` to update it. > >> > $ cordova platform update android > >> > Updated android from 3.0.0 to 3.1.0 > >> > $ cordova platform ls > >> > Installed platforms: > >> > android 3.1.0 > >> > ios 3.0.0 > >> > Available platforms: > >> > ios 3.1.0 > >> > blackberry10 3.1.0 > >> > > >> > > >> > How does `cordova update` work? > >> > - It uses platforms/*/cordova/version script to discover current > version > >> > - It fetches the new version into $HOME/.cordova/libs > >> > - It runs new_version/bin/update path/to/platforms/$PLATFORM for the > >> > specified platform > >> > > >> > The platform script is responsible for: > >> > #1 - doing all easily automated steps (update Cordova.jar, update > scripts > >> > within cordova/) > >> > #2 - Printing out a message saying what manual steps should be taken > to > >> > complete the upgrade (e.g. Please add this snippet to your > >> > ApplicationDelegate) > >> > > >> > > >> > Sound good? Any other ideas? > >> > > >> >
