From 3d27656b6b3ad04da2af8e97a8f23516373c9488 Mon Sep 17 00:00:00 2001 From: Nemo Date: Sat, 16 May 2020 00:56:21 +0530 Subject: [PATCH] Only try to sync repos that exist. Would sync the PWD otherwise --- syncrepos | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/syncrepos b/syncrepos index 6cac3a3..ff35be6 100755 --- a/syncrepos +++ b/syncrepos @@ -3,11 +3,13 @@ PATH=$PATH:/home/nemo/projects/scripts/ function sync_repo() { - pushd $1 - git config --bool branch.master.sync true - git config --bool branch.master.syncNewFiles true - git-sync - popd + if [[ -d "$1" ]]; then + pushd $1 + git config --bool branch.master.sync true + git config --bool branch.master.syncNewFiles true + git-sync + popd + fi } # xpad-notes @@ -24,4 +26,4 @@ sync_repo /home/nemo/projects/personal/mobile-passwords # scripts?: NO # imapfilter: YES # /etc: YES -# dotfiles: NO \ No newline at end of file +# dotfiles: NO