Skip to content

Commit

Permalink
docs: add fetch in script
Browse files Browse the repository at this point in the history
  • Loading branch information
addetz committed Oct 22, 2024
1 parent ac02cd0 commit 862ce42
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion scripts/find-unused-images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,17 @@ echo "Checking for unused image files in static/assets/docs/images folder..."
# Trim the path static/assets/docs/images.
find static/assets/docs/images -type f ! -name ".DS_STORE" ! -name ".DS_Store" | sed 's|static/assets/docs/images||g' > all_images.json

# Fetch all branches
git fetch origin --all

# List all the version branches
branches="master"
version_branches=$(git branch --list "version-[0-9]-[0-9]")
branches+=" $version_branches"

for current_branch in $branches; do
git checkout $current_branch
echo "Current branch: $current_branch"
git checkout origin/$current_branch
git pull

find docs -type f -name "*.md" -exec grep -Hn "\.webp" {} + > docs_used_images.json
Expand Down

0 comments on commit 862ce42

Please sign in to comment.