From 4af46ebe646c3d27be56789dc180da404a0758d5 Mon Sep 17 00:00:00 2001 From: Sage Vaillancourt Date: Fri, 30 Aug 2024 14:14:29 -0400 Subject: [PATCH 1/3] Skip certain sync operations while on sagev.space itself --- fake_home/.zshrc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/fake_home/.zshrc b/fake_home/.zshrc index 00b5580..6e0f43b 100644 --- a/fake_home/.zshrc +++ b/fake_home/.zshrc @@ -257,6 +257,10 @@ function _pushdot { git push -u origin main fi fi + if [[ "$(hostname)" != "sage-bigboy" ]]; then + cd - > /dev/null + return $res + fi push-extensions | tee -a "$SYNC_LOCK_FILE" sync-history | tee -a "$SYNC_LOCK_FILE" push-dconf | tee -a "$SYNC_LOCK_FILE" @@ -297,6 +301,10 @@ function _getdot { fi cd "$DOT_DIR" || return 1 git pull && ./copy.sh | tee -a "$SYNC_LOCK_FILE" + if [[ "$(hostname)" != "sage-bigboy" ]]; then + cd - > /dev/null + return + fi sync-history | tee -a "$SYNC_LOCK_FILE" load-extensions | tee -a "$SYNC_LOCK_FILE" From efa697a2c483b00a3fea30f942ce885389d19408 Mon Sep 17 00:00:00 2001 From: Sage Vaillancourt Date: Fri, 30 Aug 2024 14:15:55 -0400 Subject: [PATCH 2/3] Fix inverted conditionals --- fake_home/.zshrc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fake_home/.zshrc b/fake_home/.zshrc index 6e0f43b..34630c0 100644 --- a/fake_home/.zshrc +++ b/fake_home/.zshrc @@ -257,7 +257,7 @@ function _pushdot { git push -u origin main fi fi - if [[ "$(hostname)" != "sage-bigboy" ]]; then + if [[ "$(hostname)" == "sage-bigboy" ]]; then cd - > /dev/null return $res fi @@ -301,7 +301,7 @@ function _getdot { fi cd "$DOT_DIR" || return 1 git pull && ./copy.sh | tee -a "$SYNC_LOCK_FILE" - if [[ "$(hostname)" != "sage-bigboy" ]]; then + if [[ "$(hostname)" == "sage-bigboy" ]]; then cd - > /dev/null return fi From 9aa9009b830e755c99adc9bc0a5df60d4d48db07 Mon Sep 17 00:00:00 2001 From: Sage Vaillancourt Date: Fri, 30 Aug 2024 14:20:49 -0400 Subject: [PATCH 3/3] Skip mirror.sh when already on sagev.space --- copy.sh | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/copy.sh b/copy.sh index 5f0d8ab..73c43e6 100755 --- a/copy.sh +++ b/copy.sh @@ -130,17 +130,18 @@ if ! test -f "$HOME/.local/share/fonts/FiraCodeNerdFontMono-Medium.ttf"; then fc-cache -f -v fi -curdir="$(pwd)" -cd $SCRIPT_DIR || exit 1 -if test -d git-mirror-machine; then - cd git-mirror-machine - git pull -else - git clone 'https://git.sagev.space/sage/git-mirror-machine.git' - cd git-mirror-machine +if [[ "$(hostname)" != "sage-bigboy" ]]; then + curdir="$(pwd)" + cd $SCRIPT_DIR || exit 1 + if test -d git-mirror-machine; then + cd git-mirror-machine + git pull + else + git clone 'https://git.sagev.space/sage/git-mirror-machine.git' + cd git-mirror-machine + fi + cd "$curdir" || exit 1 fi -./mirror.sh -cd "$curdir" || exit 1 if ! command -v fzf &> /dev/null; then echo "You may wish to install fzf for sofi and other search"