Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrating to BS 5 #33

Open
papyr opened this issue Aug 26, 2021 · 0 comments
Open

Migrating to BS 5 #33

papyr opened this issue Aug 26, 2021 · 0 comments

Comments

@papyr
Copy link

papyr commented Aug 26, 2021

Supporting BS5 should be easy using this sed-upgrade.sh

<script src="https://gist.github.com/papyr/e44519bfcd83d2fcf2943b4ed58d2f4e.js"></script>
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
  s/([mp])r(-[0-5])/\1e\2/g
  s/no-gutters/g-0/g
  s/ close / btn-close /g
  s/arrow/popover-arrow/g
  s/arrow/popover-arrow/g
  s/left(-[0-9]*)/start\1/g
  s/right(-[0-9]*)/end\1/g
  s/(float|border|rounded|text)-left/\1-start/g
  s/(float|border|rounded|text)-right/\1-end/g
  s/font-weight(-[a-zA-Z]*)/fw\1/g
  s/font-style(-[a-zA-Z]*)/fst\1/g
}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant