diff --git a/scripts/hugo.sh b/scripts/hugo.sh index 6b4368c..5c1351b 100755 --- a/scripts/hugo.sh +++ b/scripts/hugo.sh @@ -54,6 +54,17 @@ checkos() { fi } +getArchitecture() { + architecture="$(arch)" + + if [[ $architecture = "armv7l" ]]; + then + echo "ARM" + else + echo "64bit" + fi +} + echo '🐹 Starting hugo install/update' if ! [ -x "$(command -v curl)" ]; @@ -61,8 +72,12 @@ then checkos "curl" fi +architecture=$(getArchitecture) gitlatest="https://api.github.com/repositories/11180687/releases/latest" -url=$(curl -s $gitlatest | grep -o 'https://.*hugo_extended.*_Linux-64bit.tar.gz') +echo $architecture +echo $gitlatest +url=$(curl -s $gitlatest | grep -o "https://.*hugo_extended.*_Linux-$architecture.tar.gz") +echo $url echo '✅ Found the latest version!' echo '' @@ -79,6 +94,6 @@ echo '✅ Extracted to /usr/local/bin' rm hugo_extended_latest.tar.gz echo '' -echo '👉 Current Version' $(hugo version) +echo '👉 Current Version' $(./hugo version) echo '' echo '🎉 DONE! 🎉'