Fisher: self-update: Add ability to fail unless we get a HTTP OK response from GitHub?

Created on 13 Jul 2020  ยท  5Comments  ยท  Source: jorgebucaran/fisher

Funny thing, I tried to update fisher some minutes ago, while GitHub was going through a power outage.

After I ran fisher self-update, my fisher.fish script ended up being overwritten by this:

$ cat ~/.config/fish/functions/fisher.fish
500: Internal Server Error

I've already fixed it, but it would be nice to prevent this in the future... ๐Ÿ˜„

All 5 comments

@guihkx That's amazing haha.

nice to prevent this in the future

Sure, but how?

I'm on my phone right now so I can't test this properly, but I believe curl's --fail option should prevent it. If you can test it:

$ curl --fail httpstat.us/500

IIRC, curl will return a non-zero code unless you get 200 OK as a response. Better check the manual first just to be sure :)

@guihkx Thanks, will look into it soon. ๐Ÿ‘‹

Hi again!

I've implemented this feature on my local repo, so I wanted to ask you if you're also working on it, so that I don't step on your toes. ๐Ÿ‘

Otherwise, I could just open a PR for you to review. So, let me know!

Thanks.

@guihkx No problem, send me a PR! ๐ŸŽ‰

Was this page helpful?
0 / 5 - 0 ratings