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