Pull latest main in every submodule (#8537)

* Update to latest main so that yarn.lock is always correct

* Update git-setup.sh
pull/8561/head
Hariom Balhara 2023-05-12 21:50:32 +05:30 committed by GitHub
parent 3cce4e5009
commit 749311be2a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 2 deletions

View File

@ -23,8 +23,12 @@ for module in "$@"; do
git submodule add --force $project "apps/$module"
# Set the default branch to main
git config -f .gitmodules --add "submodule.apps/$module.branch" main
# Adding the subdmoule ignores the `.gitignore` so a reset is needed
git reset
# Update to the latest from main in that submodule
cd apps/$module && git pull origin main && cd ../..
# We forcefully added the subdmoule which was in .gitignore, so unstage it.
git restore --staged apps/$module
else
# If the module is the API, display a link to request access
if [ "$module" = "api" ]; then
@ -35,3 +39,4 @@ for module in "$@"; do
fi
fi
done
git restore --staged .gitmodules