Skip to content

Commit e9be74a

Browse files
committed
Add a script to upgrade Hugo locally to the recorded version
This script currently only works on Linux. If need be, it can be extended to cover other operating systems. That will be the responsibility of people who want that support, though. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 96bc6ed commit e9be74a

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

script/upgrade-hugo.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/sh
2+
3+
die() {
4+
echo "$*" >&2
5+
exit 1
6+
}
7+
8+
HUGO_VERSION=$(sed -n 's/^ *hugo_version: *//p' <hugo.yml) &&
9+
test -n "$HUGO_VERSION" ||
10+
die "hugo_version not found in hugo.yml"
11+
12+
echo "Upgrading to Hugo v${HUGO_VERSION}" >&2
13+
14+
download_url=https://github.com/gohugoio/hugo/releases/download &&
15+
curl -Lo /tmp/hugo.deb $download_url/v$HUGO_VERSION/hugo_extended_${HUGO_VERSION}_linux-amd64.deb &&
16+
sudo dpkg -i /tmp/hugo.deb ||
17+
die "Failed to install Hugo version $HUGO_VERSION"

0 commit comments

Comments
 (0)