feat: Add architecture on hugo script

This commit is contained in:
Simon 2020-03-17 14:08:51 +01:00
parent 936a4937ea
commit d911a2e9a6
1 changed files with 17 additions and 2 deletions

View File

@ -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! 🎉'