Skip to content

Instantly share code, notes, and snippets.

View Juan-escobar94's full-sized avatar

Juan-escobar94

  • Meshmerize
  • Dresden, Germany
View GitHub Profile
@Juan-escobar94
Juan-escobar94 / migrate-b4-to-b5.sh
Last active November 8, 2023 19:42
Migrate bootstrap 4 classes to bootstrap 5.
set -x
set -e
# e.g. folder to process e.g. "frontend/"
migration_folder=$1
find_regex=".*/*.tsx?" # mach all .ts and .tsx files
# include trailing path "/" in folder parameter: e.g "frontend/" instead of just "frontend"
ignore_path="*/$1node_modules/*"
# Back up your files or change sed argument -i to -i.bak to generate backup files
find $migration_folder -regextype posix-egrep -regex $find_regex -type f -not -path $ignore_path | xargs sed -i -E '/[(class)(")]/{
s/([mp])l(-[0-5])/\1s\2/g