Commit 38f17bd2 authored by George Cushen's avatar George Cushen
Browse files

feat: update update script from Git Modules to Hugo Modules

parent 874ed281
# Academic Website Builder
# Wowchemy Website Builder
# The presence of this file is for compatibility with Blogdown and Forestry.
# If you are not using those tools, this file may be deleted.
#!/usr/bin/env bash
# Wowchemy Updater
# Checks for available updates and then asks to install any updates.
# Command: bash ./
# Check for prerequisites.
if [ ! -d content ]; then
echo "ERROR: `cd` into your website folder before running this tool."
exit 1;
# Update the Wowchemy Hugo module
function update_wowchemy () {
# Update Wowchemy to the latest master version
echo -e "Updating Wowchemy to the latest master version...\n"
hugo mod get
hugo mod tidy
# Update Netlify config
function update_netlify () {
# - Update Netlify.toml with required Hugo version
if [ -f ./netlify.toml ]; then
curl -o "tmp_get_version"
version=$(sed -n 's/^[[:space:]]*min = //p' "tmp_get_version" | tr -d '"')
echo "Set Netlify Hugo version to v${version}"
sed -i.bak -e "s/HUGO_VERSION = .*/HUGO_VERSION = \"$version\"/g" ./netlify.toml && rm -f ./netlify.toml.bak
rm tmp_get_version
# Perform update
echo "If there are breaking changes, the config and/or front matter of content" \
"may need upgrading by following the steps in the relevant consecutive release notes."
echo "View the update guide at:"
echo "View the latest release notes at:"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment