Skip to content

Commit 0b1de05

Browse files
committed
prepare for private repos not accessible
1 parent dbabeb5 commit 0b1de05

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

all-projects.sh

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -207,17 +207,22 @@ cloneFetch() {
207207
if [[ ! -d ".git" ]]; then
208208
printf "cloning %s...\n" "$repo"
209209
(
210-
git clone "https://github.com/ModelingValueGroup/$repo.git" TMP_GIT 2>&1 >/dev/null
211-
cp -R TMP_GIT/. .
212-
rm -rf TMP_GIT
213-
if [[ "$(listRemoteBranches | tr ' ' '\n' | egrep '^d$')" ]]; then
214-
git checkout develop
210+
GIT_SSH_COMMAND='ssh -oBatchMode=yes' git clone git@github.com/ModelingValueGroup/$repo.git TMP_GIT 2>&1 >/dev/null
211+
if (($? == 0)) then
212+
cp -R TMP_GIT/. .
213+
rm -rf TMP_GIT
214+
if [[ "$(listRemoteBranches | tr ' ' '\n' | egrep '^d$')" ]]; then
215+
git checkout develop
216+
fi
215217
fi
216218
) 2>&1 | sed 's/^/ # /' # 2>&1 >/dev/null
217219
fi
218-
git fetch --progress --prune --all >/dev/null 2>&1
219-
220-
echo "# done: $repo" 1>&2
220+
if [[ ! -d ".git" ]]; then
221+
echo "# not available: $repo" 1>&2
222+
else
223+
git fetch --progress --prune --all >/dev/null 2>&1
224+
echo "# done: $repo" 1>&2
225+
fi
221226
)&
222227
}
223228
pullAll() {

0 commit comments

Comments
 (0)