Skip to content

Commit

Permalink
Update script to use cd - instead of pushd/popd for sh compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
jb3 committed Aug 26, 2024
1 parent 738bf75 commit c792c41
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions ansible/roles/git-mirrors/templates/update-mirrors.sh.j2
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ MIRRORS_BASE_DIR="{{ git_mirrors_base_dir }}/mirrored"
FOUND_REPOS=$(find "$MIRRORS_BASE_DIR" -name "HEAD" -print0 | xargs -0 dirname)

for repo in $FOUND_REPOS; do
pushd

cd "$repo";
echo "Updating $repo mirror..."
if ! git fetch -q --prune; then
Expand All @@ -19,5 +17,5 @@ for repo in $FOUND_REPOS; do
fi
echo "Updated repository."

popd
cd -
done

0 comments on commit c792c41

Please sign in to comment.