From a86f247bead7a8b938c94190d307a154873f263a Mon Sep 17 00:00:00 2001 From: Ohad Livne Date: Wed, 4 Jun 2025 22:47:36 +0300 Subject: [PATCH] Add an option to list known repositories --- .local/bin/sync-git-repos | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/.local/bin/sync-git-repos b/.local/bin/sync-git-repos index d0ff8a3..a30bf3c 100755 --- a/.local/bin/sync-git-repos +++ b/.local/bin/sync-git-repos @@ -16,8 +16,14 @@ sync_repo () { echo } -while read -r repo_root; do - for repo in $(list_repos "${repo_root}"); do - sync_repo "${repo}" - done -done < "${REPO_ROOT_FILE}" +if [ "list" = "$1" ]; then + while read -r repo_root; do + list_repos "${repo_root}" + done < "${REPO_ROOT_FILE}" +else + while read -r repo_root; do + for repo in $(list_repos "${repo_root}"); do + sync_repo "${repo}" + done + done < "${REPO_ROOT_FILE}" +fi