Dmitrii Aleksandrov

Fearless Hugo Updates With HVM

Posted on 1 min

Tech

Two things happened on the same day that I posted “Fearless Website Updates With Hugo” :

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.


  1. Ok, I lied a little. Because of the way hvm works (shadowing the hugo binary with a Bash function), I had to source ~/.bash_aliases in the script. If hvm used something like a symlink in PATH instead, I wouldn’t have to do anything. ↩︎

Comments