From b35022a6847d095590e23199e9cfeca345a16216 Mon Sep 17 00:00:00 2001 From: Sage Vaillancourt Date: Sat, 24 Feb 2024 13:12:23 -0500 Subject: [PATCH] Don't push extensions if they haven't changed --- fake_home/.zshrc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/fake_home/.zshrc b/fake_home/.zshrc index 91c3b01..7208c10 100644 --- a/fake_home/.zshrc +++ b/fake_home/.zshrc @@ -118,7 +118,12 @@ function push-extensions { echo "gnome-extensions is not installed!" return fi + mv /tmp/gnome-extension-list /tmp/prev-gnome-extension-list &> /dev/null 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' } @@ -127,6 +132,7 @@ function load-extensions { echo "gnome-extensions is not installed!" return fi + scp -P 11275 'sage@sagev.space:~/gnome-extension-list' /tmp/gnome-extension-list local existing="$(gnome-extensions list)" for ext in $(cat /tmp/gnome-extension-list); do if grep "$ext" <(echo $existing) &> /dev/null; then @@ -167,9 +173,8 @@ function getdot { fi cd "$DOT_DIR" || return 1 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 + rm /tmp/dconf-dump &> /dev/null scp -P 11275 'sage@sagev.space:~/dconf-dump' /tmp/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