Skip to content

Commit

Permalink
Edit the yarn git-update script
Browse files Browse the repository at this point in the history
Only execute a shallow/single-branch submodule fetch if running the
script on the AWS Amplify build runner. Otherwise, fetch all submodules
refs to help with local development.
  • Loading branch information
ptgott committed Jan 9, 2025
1 parent 1913c67 commit ead1d16
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"scripts": {
"spellcheck": "bash scripts/check-spelling.sh",
"build-remark": "rm -rf .remark-build && tsc --build tsconfig.node.json && tsc-esm-fix --target='.remark-build' --ext='.mjs'",
"git-update": "git submodule update --init --remote --progress --depth 1 --single-branch",
"git-update": "scripts/update_submodules.sh",
"prepare-files": "npx vite-node ./scripts/prepare-files.mts",
"prepare-sanity-data": "npx vite-node ./scripts/prepare-sanity-data.mts",
"docusaurus": "docusaurus",
Expand Down
9 changes: 9 additions & 0 deletions scripts/update_submodules.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

# Fetch all submodule refs on a local machine. On the AWS Amplify build runner,
# only execute a shallow fetch with a single branch.
if [[ -n ${AWS_APP_ID} ]]; then
git submodule update --init --remote --progress --depth 1 --single-branch
else
git submodule update --init --remote --progress
fi

0 comments on commit ead1d16

Please sign in to comment.