One nice side effect of using vcsh was developing more complex scripts to help me do things. I didn’t have to worry a script or tool would get lost when a machine inevitibly died.
However before writing a script, sometimes it’s not a bad idea to check and see if someone else already has. Lately many of those that I’ve found have been in Go.
Originally I did these with update but it made
update take a long time to run and sometimes
with die if a rarely used Go util was broken.
Based on that I switched to shell stubs to install them if they’re missing and then run them. However most of these tools are in regular development so it’s also nice to keep them current. Again, local stamp files come into play.
__get_and_run_go_binary function comes from the
It’s also rather simple, but putting it all here makes for much
smaller stub files and stops me reinventing all the same mistakes
I make in such stub files.
One thing to note is that it’s sometimes hard to derive the binary name from the repo name. Go has some rules for stripping those names that I don’t fully know. So rather than try and figure them out - and mess up at some future point when they change - I just put the binary name in explicitly.