From d7fb4495f1878baa92c455e202c6d9047f30dfb0 Mon Sep 17 00:00:00 2001 From: Jobin Kurian Date: Fri, 7 Jul 2023 08:38:23 +0530 Subject: [PATCH] I have made two improvements to the git-bulk: (#1054) * I have made two improvements to the git-bulk: 1. Previously, if the "repository.txt" file did not end with a blank line, only three out of four repositories were cloned. This limitation has been fixed. 2. Now, there is support for cloning repositories into custom folder names when using the "repository.txt" file. * Corrected the code indentation. * removed the extra condition to check is the line was empty or not. * Updated the comment for the new changes in the code. --------- Co-authored-by: Jobin Kurian --- bin/git-bulk | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bin/git-bulk b/bin/git-bulk index ff3021f..3480bb4 100755 --- a/bin/git-bulk +++ b/bin/git-bulk @@ -36,7 +36,12 @@ function addworkspace { source=$(realpath "$source" 2>/dev/null) if [ -f "$source" ]; then pushd "$wsdir" > /dev/null - while read -r line; do git clone "$line"; done < "$source"; + while IFS= read -r line; do + if [ -n "$line" ]; then + # the git clone command to take the complete line in the repository.txt as separate argument. This facilitated the cloning of the repository with a custom folder name. + git clone $line; + fi + done < "$source" popd > /dev/null else echo 1>&2 "format of URL or file unknown"