Fearless Hugo Updates With HVM
Two things happened on the same day that I posted “Fearless Website Updates With Hugo” :
- I discovered
grouse- a tool for diffing the generated Hugo sites, very similar to my script from the previous post. You may prefer to adoptgrouseinstead. - In the comments,
u/McShelbyrecommended mehvmas a way to automate Hugo upgrades in my script.
grouse doesn’t support diffing staged
changes
and doesn’t offer me any
obvious benefits over a shell script. But hvm sparked my interest.
I tried it, and indeed, it works like a charm. After installing and configuring
hvm, now updating Hugo and reviewing the impact is as simple as hvm use latest && git add .hvm && ./review_staged_changes.sh. This works with no
changes to my script1 because .hvm is just a regular file in the
repo, tracked by Git. So, the selected Hugo version can be rolled back with git stash just like any other change. Cool! Another problem solved.
Ok, I lied a little. Because of the way
hvmworks (shadowing thehugobinary with a Bash function), I had tosource ~/.bash_aliasesin the script. Ifhvmused something like a symlink inPATHinstead, I wouldn’t have to do anything. ↩︎
Comments