-
-
Save Juan-escobar94/f76535a1264ac6f7251c643af50c184d to your computer and use it in GitHub Desktop.
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/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 | |
}' |
Hello. Please tell me how to use this converter correctly and for which operating system it is intended?
Hey! its intended to be used on a gnu/linux machine, I used ubuntu 20.04 iirc. I would guess there are better migration tools out there now tbh! And I do not know if b5 has made any other big changes that would make this script obsolete... I would advise you to rather find something else ;)
Anyways,
the script takes a directory as its only argument, for example: ./migrate-b4-to-b5.sh my-folder/
Hello,
Thank you for this script. I just used it and maybe one suggestion for the next visitor. The pattern 'arrow' break the font awesome icon "fa-arrow". And in fact, the line 14 and 15 are the same, so it gives you "popover-popover-arrow" :-)
Hello,
Thank you for this script. I just used it and maybe one suggestion for the next visitor. The pattern 'arrow' break the font awesome icon "fa-arrow". And in fact, the line 14 and 15 are the same, so it gives you "popover-popover-arrow" :-)
Thanks! just updated it
Thanks!
Hello. Please tell me how to use this converter correctly and for which operating system it is intended?