mirror of
https://github.com/tj/git-extras.git
synced 2026-09-10 07:26:17 -04:00
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 <jobin.kurian@netcorecloud.com>
This commit is contained in:
parent
5e543cb620
commit
d7fb4495f1
|
|
@ -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"
|
||||
|
|
|
|||
Loading…
Reference in a new issue