Fix upgrade_system for asdf plugins

This commit is contained in:
Tony Blyler 2023-09-28 10:10:41 -04:00
parent 1a3d94d1fa
commit 88240f9731
2 changed files with 28 additions and 6 deletions

View file

@ -1,3 +1,4 @@
golang 1.21.1
chezmoi 2.39.1
nodejs 18.17.1
chezmoi 2.40.0
nodejs 18.18.0
python 3.11.5

View file

@ -38,10 +38,31 @@ upgrade_system() {
esac
if command -v asdf &> /dev/null; then
asdf update || true
asdf plugin update --all
asdf latest --all
asdf nodejs resolve lts --latest-avaliable
(
cd "$HOME"
asdf update || true
asdf plugin update --all
asdf latest --all | grep -Ev '^(python|nodejs)'
LATEST_PYTHON_VERSION="$(asdf latest python)"
CURRENT_PYTHON_VERSION="$(asdf current python | awk '{print $2}')"
echo -en "python\t${LATEST_PYTHON_VERSION}\t"
if [[ "$LATEST_PYTHON_VERSION" == "$CURRENT_PYTHON_VERSION" ]]; then
echo "installed"
else
echo "missing"
fi
asdf list all nodejs |
awk -v lts="$(asdf nodejs resolve lts)" \
-v current="$(asdf current nodejs | awk '{print $2}')" \
'index($0, lts) == 1 {latest=$0} END {
printf "nodejs\t"latest"\t"
if(latest == current) {
print "installed"
} else {
print "missing"
}
}'
)
fi
if command -v fwupdmgr &> /dev/null; then