buo / homebrew-cask-upgrade

A command line tool for upgrading every outdated app installed by Homebrew Cask
MIT License
2.44k stars 90 forks source link

Introduce a "interactive" mode: as for each cask separatly to install #135

Closed muescha closed 5 years ago

muescha commented 5 years ago

when:

what i see:

what i expected:

ondrejfuhrer commented 5 years ago

Hey @muescha , interesting suggestion 👍 I'll look into it when I have a little bit of free time 🙂

yurikoles commented 5 years ago

My suggestion is to have:

1. app1
2. app2
3. app3
...
10. app10
Choose apps or (a)ll (default): 

Then you may answer with ranges, e.g.: 1-3,8-9

ondrejfuhrer commented 5 years ago

@yurikoles Not sure if that is not too complicated for what it is worth. You either want interactive, were you will confirm every single app separately or install all. There is usually not much cases when you would use the interactive case, at least for me.

@muescha Can you also put more though into the use case? I can imagine that a user would use it in a case, when he doesn't wan't to update certain app for a reason.

So it would be like this:

  1. brew cu
  2. use (i)
  3. Skip one app
  4. pin the app so it doesn't "bother" me again

I can also see that the use case could look like this (without this feature needed)

  1. brew cu
  2. use (N)
  3. brew cu --pin cask
  4. brew cu
  5. use (y)

Yes, there is one more step, but would make the same case. Or is there a situation when you would use the (i) option again and again?

muescha commented 5 years ago

option B is also possible as workaround - but sometimes i would have to see always the (for now skipped) casks to remember me that i need an update thats why my idea for your option A

maybe you include the outdated and pinned casks better in the output:

> brew cu --pin eclipse-installer
Pinned: eclipse-installer                                                                                                                                               

> brew cu
==> Options                                                                                                                                                             
Include auto-update (-a): false                                                                                                                                         
Include latest (-f): false                                                                                                                                              
==> Updating Homebrew                                                                                                                                                   
Already up-to-date.                                                                                                                                                     
==> Finding outdated apps                                                                                                                                               
       Cask                       Current                                          Latest                                           A/U    Result                       
 1/86  accessmenubarapps          2.6.1                                            2.6.1                                                 [   OK   ]                     
...
23/86  eclipse-installer          4.9.0,2018-09:R                                  4.10.0,2018-12:R                                      [ PINNED ]                     
...
85/86  webpquicklook              latest                                           latest                                                [   OK   ]                     
86/86  wwdc                       5.0.6                                            6.0.4                                             Y   [  PASS  ] 

==> Found outdated and pinned apps -> ignored for upgrade                                                                                                                                                 
     Cask               Current              Latest            A/U    Result                                                                                            
1/1  eclipse-installer  4.9.0,2018-09:R      4.10.0,2018-12:R       [ PINNED ]                     

==> Found outdated apps                                                                                                                                                 
     Cask               Current              Latest            A/U    Result                                                                                            
1/5  dbeaver-community  5.3.3                5.3.4                  [OUTDATED]                                                                                          
2/5  eclipse-jee        4.9.0,2018-09:R      4.10.0,2018-12:R       [OUTDATED]                                                                                          
3/5  java               11.0.1,13            11.0.2,9               [OUTDATED]                                                                                          
4/5  qlvideo            1.91,1.90,1.87,1.89  1.92                   [OUTDATED]                                                                                          
5/5  sweet-home3d       6.0                  6.1.2                  [OUTDATED]                                                                                          

Do you want to upgrade 5 apps [y/N]? n 
muescha commented 5 years ago

yes in interactive mode there can be an: * Do you want to upgrade or pin his app [y/p/N]?

or

* Do you want to upgrade this app [y/N] or pin this app [p] ?

muescha commented 5 years ago

other idea to have a -g or --grouped option to group the big list in the order: [OK] / [PASS] / [ PINNED] / [FORCED] / [OUTDATED]

ondrejfuhrer commented 5 years ago

Hey @muescha , I think in this stage would be really great if you can write a use case / problem you are trying to solve with this new approach. Then I think we can discuss te right approach to handle this issue.

At this point I don't think a global option (i.e. brew cu --interactive) is going to be a good solution, because then you would need to confirm every single app update which could be quite annoying.

So as far as I see the use case is I run brew cu and in the list I see an app that I don't want to update for whatever reason, right? So the option has to be somehow included there.

Or is there another use case that I'm missing here?

muescha commented 5 years ago

annoying: it depends of the point of view - to confirm every single update would be less annoying than manually to type many times to brew cu caskname for each app i would like to install and then again with y/N.

but yes the use case is: when i see my list with a brew cu and then i like to exclude 1 (or more) casks only in the current run, but not for all following runs. i like to be remembered with brew cu that are some updates still exists in the next run.

ondrejfuhrer commented 5 years ago

Yes, you are right. But of course you have to take into account that you can still run brew cu, if there is app you don't want to update, then pin it and re-run it again 🙂 So it is basically one more command you have to run.

For me personally it happens to me a lot, that I run brew cu, confirm all the app I'm going to update and then work on something else... and after an hour I see, that some of the casks asked for my admin password 😄 So it would be "annoying" to have to check every single app if that went through.

In your case I think that the suitable solution could be having 3 options when asking if to update - y, i, N where i would start that interactive flow where you have to confirm every single app.

I guess that might be suitable. Maybe @buo has something against? And how about @yurikoles , what do you think?

ondrejfuhrer commented 5 years ago

Hey @muescha I just introduced a PR that should work as described here. If you want, you can check it out. If you need help checking out the code, just go to your tap folder (usually /usr/local/Homebrew/Library/Taps/buo/homebrew-cask-upgrade) and follow instructions for checking out pull request locally.

Please not that you will also need to reset the code when it get's merged by running (git checkout master).

Now it's waiting for @buo to review and merge it 🙂

muescha commented 5 years ago

i did checkout the PR - worked like expected :) thx

Wdavery commented 5 years ago

Best update ever. Love this new feature!