Last active
August 17, 2023 10:51
-
-
Save christianwgd/c579a87ed4edcdc768cc3005c5135c86 to your computer and use it in GitHub Desktop.
Bash script for basic migration from django-bootstrap4 to django-bootstrap5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find . -type f -name \settings.py -exec sed -i '' -e "s|'bootstrap4',|'django_bootstrap5',|g" {} \; | |
find . -type f -name \*.html -exec sed -i '' -e "s|bootstrap4\/bootstrap4.html|django_bootstrap5\/bootstrap5.html|g" {} \; | |
find . -type f -name \*.html -exec sed -i '' -e "s|bootstrap4_extra_head|bootstrap5_extra_head|g" {} \; | |
find . -type f -name \*.html -exec sed -i '' -e "s|bootstrap4_extra_script|bootstrap5_extra_script|g" {} \; | |
find . -type f -name \*.html -exec sed -i '' -e "s|bootstrap4_title|bootstrap5_title|g" {} \; | |
find . -type f -name \*.html -exec sed -i '' -e "s|bootstrap4_content|bootstrap5_content|g" {} \; | |
find . -type f -name \*.html -exec sed -i '' -e "s| bootstrap4 | django_bootstrap5 |g" {} \; | |
find . -type f -name \*.html -exec sed -i '' -e "s|data-toggle=|data-bs-toggle=|g" {} \; | |
find . -type f -name \*.html -exec sed -i '' -e "s|data-dismiss=|data-bs-dismiss=|g" {} \; | |
find . -type f -name \*.html -exec sed -i '' -e "s|data-targe=|data-bs-targe=|g" {} \; | |
find . -type f -name \*.html -exec sed -i '' -e "s|data-parent=|data-bs-parent=|g" {} \; | |
find . -type f -name \*.html -exec sed -i '' -e "s|mr-auto|me-auto|g" {} \; | |
find . -type f -name \*.html -exec sed -i '' -e "s|ml-auto|ms-auto|g" {} \; | |
find . -type f -name \*.html -exec sed -i '' -e "s|dropdown-menu-right|dropdown-menu-end|g" {} \; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Copy the bash script to the root of your django project and make it executable with "chmod +x bs4-2-bs5.sh, run with ./bs4-2-bs5.sh