From 544da1ba50d9cbf51a18ca0abf1db66b3baa7460 Mon Sep 17 00:00:00 2001 From: Andrew Opalach Date: Fri, 17 Oct 2025 12:22:00 -0400 Subject: Gentoo desktop --- scripts/sync/pull.sh | 8 ++++++-- scripts/sync/push.sh | 10 ++++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) (limited to 'scripts/sync') diff --git a/scripts/sync/pull.sh b/scripts/sync/pull.sh index 1bf5b48..924499a 100755 --- a/scripts/sync/pull.sh +++ b/scripts/sync/pull.sh @@ -3,7 +3,7 @@ set -e SOURCE="$(cat remote)/" -if [ ! -d $SOURCE ]; then +if [ ! -d $SOURCE ] && [[ ! $SOURCE =~ ":" ]]; then echo "Path $SOURCE does not exist." exit 1 fi @@ -24,6 +24,10 @@ while getopts 'cfdr' opt; do r) # Revert FORCE=1 ;; + *) + echo "Unknown argument" + exit 1 + ;; esac done @@ -31,4 +35,4 @@ if [ $FORCE = 0 ]; then ARGS+=('--update') fi -rsync --archive --itemize-changes "${ARGS[@]}" $SOURCE . +rsync --archive --itemize-changes "${ARGS[@]}" $SOURCE/$2 . diff --git a/scripts/sync/push.sh b/scripts/sync/push.sh index 3adbd02..9e35994 100755 --- a/scripts/sync/push.sh +++ b/scripts/sync/push.sh @@ -1,9 +1,11 @@ #! /usr/bin/env sh +# https://serverfault.com/a/211083 + set -e DEST="$(cat remote)" -if [ ! -d $DEST ]; then +if [ ! -d $DEST ] && [[ ! $DEST =~ ":" ]]; then echo "Path $DEST does not exist." exit 1 fi @@ -24,6 +26,10 @@ while getopts 'cfdr' opt; do r) # Revert FORCE=1 ;; + *) + echo "Unknown argument" + exit 1 + ;; esac done @@ -31,4 +37,4 @@ if [ $FORCE = 0 ]; then ARGS+=('--update') fi -rsync --archive --itemize-changes "${ARGS[@]}" ./ $DEST +rsync --archive --itemize-changes "${ARGS[@]}" ./$2 $DEST -- cgit v1.2.3-101-g0448