r-darwish / topgrade

Upgrade everything
GNU General Public License v3.0
3.36k stars 160 forks source link

steps: vim: Show outputs, simplify error handling #874

Closed har7an closed 2 years ago

har7an commented 2 years ago

Print stdout and stderr directly to the invoking terminal, rather than collecting them and only printing them when the update failed. Simplifies error handling by having the executor check for the command exit status and automatically handling dry runs.

Background: I use dein as plugin manager for vim and had setup a custom update command for that in my topgrade config. I forgot to remove it after #857 was merged, so it stuck around. Recently I discovered that vim-airline had a rewrite in its git-history, causing the update to fail but without dein returning an error exit status (i.e. it still returned 0). Thus the vim upgrade step would report "Plugins updated", whereas in the custom commands output I could see that it failed to upgrade one plugin. Since the other steps (at least the ones I use) also don't work silently (i.e. without showing me stdout/stderr), I decided to update the vim step to behave the same.

Standards checklist:

If you developed a feature or a bug fix for someone else and you do not have the means to test it, please tag this person here.

r-darwish commented 2 years ago

As I recall this change was made because most plugin managers would output garbage. Is there any way to change the vim script so that it properly returns 1 when dein fails?