Browse Source

show-extension-versions: Nicer output, list not-installed

master
Felix 2 months ago
parent
commit
47c0eb1781
1 changed files with 34 additions and 4 deletions
  1. +34
    -4
      vars/show-extension-versions.sh

+ 34
- 4
vars/show-extension-versions.sh View File

@@ -1,17 +1,47 @@
#!/bin/env sh
enabled_extensions=$(gsettings get org.gnome.shell enabled-extensions | sed -e 's/[][]//g' | sed -e "s/'//g" | sed -e 's/ //g' | tr ',' '\n')

echo ""
echo "== Potentially outdated =="
echo ""

all_good=true
for i in $enabled_extensions; do
version_installed=$(cat ~/.local/share/gnome-shell/extensions/$i/metadata.json | grep -e "\"version" | rev | cut -d ' ' -f 1 | rev)
version_in_yaml=$(cat extensions.yml | grep $i -A 1 -B 0 | tail -n 1 | cut -d "'" -f 2)
if [ $version_installed == $version_in_yaml ]; then
if [ -z $version_installed ]; then
echo "== WARNING =="
echo " Extension $i listed as installed, but no metadata.json found"
echo " Should be in ~/.local/share/gnome-shell/extensions/$i/metadata.json"
echo "============="
all_good=false
continue
fi
version_in_yaml=$(grep -v '^\s*#' extensions.yml | grep $i -A 1 -B 0 | tail -n 1 | cut -d "'" -f 2)
if [ -z $version_in_yaml ]; then
echo " - Not in yml: $i, is: v$version_installed [current]"
all_good=false
continue
fi
if [ "$version_installed" == "$version_in_yaml" ]; then
:
else
echo "$i v$version_in_yaml[in yml] -> v$version_installed[current]"
echo "- $i v$version_in_yaml [in yml] -> v$version_installed [current]"
all_good=false
fi
done
if [ "$all_good" == true ]; then
echo "All good"
echo "-> All good"
fi

echo ""
echo "== Potentially missing =="
echo ""

# Now, all listed but not installed:
all_in_yml=$(grep -v '^\s*#' extensions.yml | grep '@' | cut -d "'" -f 4)
enabled_extensions=$(gsettings get org.gnome.shell enabled-extensions | sed -e 's/[][]//g' | sed -e "s/'//g" | sed -e 's/ //g' | tr ',' '\n')
for i in $all_in_yml; do
if [ -z "$(echo $enabled_extensions | grep $i)" ]; then
echo " - $i [in yml]"
fi
done

Loading…
Cancel
Save