I decided to upgrade the version of Hugo my sites use today. That didn’t go to plan.
PKG
My workflow for installing Hugo versions on my Mac, was to download the tarball, and extract it into /opt/user/bin/. My script for this lets me give a version number, or just tell it to grab the latest one. This has been working without issue for over a year.
Well it broke. Because the Mac version of Hugo is no longer offered as a tarball, but a .pkg. I’m not big on .pkgs, as they can be a pain to uninstall.
So I started thinking. Hugo is available in brew, and I can pin a package in brew so it doesn’t update. However, only the latest version is available in brew, and I can’t downgrade if I need to. So fine. I’ll build it myself.
All I did was replace the download bits of the script, with a go install command.
go install -v github.com/gohugoio/hugo@v$HVer
Does it take longer than downloading it, yes. But I’m cool with that.