Don't push extensions if they haven't changed

This commit is contained in:
Sage Vaillancourt 2024-02-24 13:12:23 -05:00
parent 2a0c7d996f
commit b35022a684
1 changed files with 7 additions and 2 deletions

View File

@ -118,7 +118,12 @@ function push-extensions {
echo "gnome-extensions is not installed!" echo "gnome-extensions is not installed!"
return return
fi fi
mv /tmp/gnome-extension-list /tmp/prev-gnome-extension-list &> /dev/null
gnome-extensions list > /tmp/gnome-extension-list gnome-extensions list > /tmp/gnome-extension-list
# If there is NO difference, skip scp
if [[ "$1" != "--force" ]] && diff /tmp/gnome-extension-list /tmp/prev-gnome-extension-list &> /dev/null; then
return
fi
scp -P 11275 /tmp/gnome-extension-list 'sage@sagev.space:~/gnome-extension-list' scp -P 11275 /tmp/gnome-extension-list 'sage@sagev.space:~/gnome-extension-list'
} }
@ -127,6 +132,7 @@ function load-extensions {
echo "gnome-extensions is not installed!" echo "gnome-extensions is not installed!"
return return
fi fi
scp -P 11275 'sage@sagev.space:~/gnome-extension-list' /tmp/gnome-extension-list
local existing="$(gnome-extensions list)" local existing="$(gnome-extensions list)"
for ext in $(cat /tmp/gnome-extension-list); do for ext in $(cat /tmp/gnome-extension-list); do
if grep "$ext" <(echo $existing) &> /dev/null; then if grep "$ext" <(echo $existing) &> /dev/null; then
@ -167,9 +173,8 @@ function getdot {
fi fi
cd "$DOT_DIR" || return 1 cd "$DOT_DIR" || return 1
git pull && ./copy.sh git pull && ./copy.sh
rm /tmp/dconf-dump &> /dev/null
scp -P 11275 'sage@sagev.space:~/gnome-extension-list' /tmp/gnome-extension-list
load-extensions load-extensions
rm /tmp/dconf-dump &> /dev/null
scp -P 11275 'sage@sagev.space:~/dconf-dump' /tmp/dconf-dump scp -P 11275 'sage@sagev.space:~/dconf-dump' /tmp/dconf-dump
dconf-dump > /tmp/current-dconf-dump dconf-dump > /tmp/current-dconf-dump
if ! git --no-pager diff --no-index /tmp/current-dconf-dump /tmp/dconf-dump &> /dev/null; then if ! git --no-pager diff --no-index /tmp/current-dconf-dump /tmp/dconf-dump &> /dev/null; then