jorgebucaran / fisher

A plugin manager for Fish
https://git.io/fisher
MIT License
7.53k stars 257 forks source link

Have `fisher update` report when no updates are applied #695

Closed giorgiga closed 2 years ago

giorgiga commented 2 years ago

I'm running fisher update from an ansible playbook and it would be nice to be able to tell when files were actually changed in the filesystem... maybe there could be some option that makes fisher update return an error code where updating resulted in a noop?

Alternatively, a separate command to query if updates are needed would also solve my use case (but, if I correctly understand how fisher works, that would basically be the same as the option above).

jorgebucaran commented 2 years ago

fisher update could only attempt to update what needs updating, and fail when no update is possible. But how to tell if a plugin has updates available?

giorgiga commented 2 years ago

I don't really know how fisher works (didn't peek into the sources), but I guess it could compare checksums before applying changes to the filesystem and keep track of if anything needs to change?

jorgebucaran commented 2 years ago

Perhaps, when updating plugins, after we've downloaded them (GitHub doesn't seem to make release checksums automatically for us at this time1) we could hash-compare file by file until we find the first mismatch.

giorgiga commented 2 years ago

I ended up looking at the source, at it seems cp -Rf is used to copy the downloaded files to .config/fish: if that's in fact the case, then diff -r might be of help (unless it turns out the -r is not widely available, but IIRC both busybox and bsd diff support it)

jorgebucaran commented 2 years ago

Closing as not planned (for now).