Skip to content

Commit

Permalink
Update git-mirrors.sh
Browse files Browse the repository at this point in the history
while loop executes in subshell and value of STATUS is lost
this fixes that
  • Loading branch information
jimr6007 committed Mar 14, 2016
1 parent 8421410 commit ac44d92
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions git-mirrors.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@ cd "${git_mirrors_dir}"

STATUS=0

ls -1 "${repo_dir}/${gitlab_namespace}" | while read mirror;do
while read mirror
do
if ! ./update_mirror.sh "${mirror}" >> ${git_mirrors_dir}/cron.log 2>&1 ;then
red_echo "Error: ./update_mirror.sh ${mirror} (more information in ${git_mirrors_dir}/cron.log)" 1>&2
STATUS=1
fi
done
done <<< "$(ls -1 "${repo_dir}/${gitlab_namespace}")"

exit ${STATUS}

0 comments on commit ac44d92

Please sign in to comment.