3 changed files with 77 additions and 2 deletions
@ -0,0 +1,75 @@
|
||||
#!/usr/bin/env bash |
||||
# Cleanup script for olivesbooks Drupal 10 theme |
||||
# Run this from the root of the olivesbooks git repo. |
||||
# |
||||
# Usage: |
||||
# chmod +x cleanup-olivesbooks.sh |
||||
# ./cleanup-olivesbooks.sh |
||||
# |
||||
# By default this only runs Tier 1 (safe backup/temp files) and the |
||||
# social-bar_.css duplicate fix. Tier 2 (likely-dead assets) is |
||||
# commented out — review that section and uncomment what you're |
||||
# comfortable removing after eyeballing the live site. |
||||
|
||||
set -e |
||||
|
||||
echo "=== Tier 1: backup/temp files (safe) ===" |
||||
git rm favicon.ico.old |
||||
git rm .prettierrc_old |
||||
git rm temp.html |
||||
git rm templates/includes/lp-banner.html.twig.old |
||||
git rm "templates/mirador.html.twig~" |
||||
git rm templates/views/views-view-fields--solr-search-content.html.twig.old |
||||
git rm css/components/islandora_mods.css.bk |
||||
git rm images/bookshelf.webp.bk |
||||
|
||||
echo "=== .DS_Store cleanup + gitignore ===" |
||||
git rm --cached .DS_Store 2>/dev/null || true |
||||
git rm --cached fonts/.DS_Store 2>/dev/null || true |
||||
if ! grep -q "^\.DS_Store$" .gitignore 2>/dev/null; then |
||||
echo ".DS_Store" >>.gitignore |
||||
git add .gitignore |
||||
fi |
||||
|
||||
# echo "=== social-bar_.css duplicate ===" |
||||
# git rm css/layout/social-bar_.css |
||||
# Also remove its entry from olivesbooks.libraries.yml manually: |
||||
# css/layout/social-bar_.css: {} |
||||
# (one line, under global-styling > css > layout) |
||||
|
||||
echo "" |
||||
echo "=== Tier 2: likely-dead CSS/images (REVIEW BEFORE RUNNING) ===" |
||||
echo "Uncomment lines below after confirming these aren't used on the live site." |
||||
echo "" |
||||
|
||||
# --- Unreferenced CSS --- |
||||
# git rm css/layout/wide-nav-expand.css |
||||
# git rm css/base/media-queries.css |
||||
|
||||
# --- Unreferenced images --- |
||||
# git rm images/telescope.svg |
||||
# git rm images/sextant.svg |
||||
# git rm images/sextant_old.svg |
||||
# git rm images/old-books-ladder.jpg |
||||
# git rm images/chevron-down.svg |
||||
# git rm images/background.svg |
||||
# git rm images/bookshelf_02.jpg |
||||
# git rm images/bookshelf.jpg |
||||
# git rm images/bookshelf.webp |
||||
# git rm images/search--white.svg |
||||
# git rm images/pei_map.jpg |
||||
# git rm images/pei_map_banner.jpg |
||||
# git rm images/imagined_logo.svg |
||||
# git rm images/throbber.svg |
||||
|
||||
# --- Disabled/unreferenced JS --- |
||||
# git rm js/nav-resize.js |
||||
# (also remove the commented-out line in olivesbooks.libraries.yml: |
||||
# # js/nav-resize.js: {} |
||||
# under navigation-primary > js) |
||||
|
||||
echo "" |
||||
echo "Done with enabled sections. Review the commit before pushing:" |
||||
echo " git status" |
||||
echo " git diff --cached --stat" |
||||
echo " git commit -m 'Remove obsolete backup/temp files and duplicate social-bar CSS'" |
||||
Loading…
Reference in new issue