feat: Add architecture on hugo script
This commit is contained in:
parent
936a4937ea
commit
d911a2e9a6
|
@ -54,6 +54,17 @@ checkos() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getArchitecture() {
|
||||||
|
architecture="$(arch)"
|
||||||
|
|
||||||
|
if [[ $architecture = "armv7l" ]];
|
||||||
|
then
|
||||||
|
echo "ARM"
|
||||||
|
else
|
||||||
|
echo "64bit"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
echo '🐹 Starting hugo install/update'
|
echo '🐹 Starting hugo install/update'
|
||||||
|
|
||||||
if ! [ -x "$(command -v curl)" ];
|
if ! [ -x "$(command -v curl)" ];
|
||||||
|
@ -61,8 +72,12 @@ then
|
||||||
checkos "curl"
|
checkos "curl"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
architecture=$(getArchitecture)
|
||||||
gitlatest="https://api.github.com/repositories/11180687/releases/latest"
|
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 '✅ Found the latest version!'
|
||||||
echo ''
|
echo ''
|
||||||
|
@ -79,6 +94,6 @@ echo '✅ Extracted to /usr/local/bin'
|
||||||
|
|
||||||
rm hugo_extended_latest.tar.gz
|
rm hugo_extended_latest.tar.gz
|
||||||
echo ''
|
echo ''
|
||||||
echo '👉 Current Version' $(hugo version)
|
echo '👉 Current Version' $(./hugo version)
|
||||||
echo ''
|
echo ''
|
||||||
echo '🎉 DONE! 🎉'
|
echo '🎉 DONE! 🎉'
|
||||||
|
|
Loading…
Reference in New Issue