Skip to content

Commit

Permalink
I have made two improvements to the git-bulk: (#1054)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
icodebuster and Jobin Kurian authored Jul 7, 2023
1 parent 5e543cb commit d7fb449
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion bin/git-bulk
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit d7fb449

Please sign in to comment.