Skip to content

Instantly share code, notes, and snippets.

@fay
Last active August 29, 2015 13:57
Show Gist options
  • Save fay/9614747 to your computer and use it in GitHub Desktop.
Save fay/9614747 to your computer and use it in GitHub Desktop.
migrate bootstrap 2.x to 3.x
sed -i "s/span\([0-9][0-9]*\)/col-md-\1/g" `ack-grep --type=html -l "span\d+"`
sed -i "s/row-fluid/row/g" `ack-grep --type=html -l "row-fluid"`
sed -i "s/offset\([0-9][0-9]*\)/col-md-offset-\1/g" `ack-grep --type=html -l "offset\d+"`
# need to revert the `icon-bar`
sed -i "s/icon-/glyphicon glyphicon-/g" `ack-grep --type=html -l "icon-"`
sed -i "s/btn-mini/btn-xs/g" `ack-grep --type=html -l "btn-mini"`
sed -i "s/btn-small/btn-sm/g" `ack-grep --type=html -l "btn-small"`
sed -i "s/btn-large/btn-lg/g" `ack-grep --type=html -l "btn-large"`
sed -i "s/class=\"btn\"/class=\"btn btn-default\"/g" `ack-grep --type=html -l "class=\"btn\""`
sed -i "s/control-group/form-group/g" `ack-grep --type=html -l "control-group"`
sed -i "s/checkbox inline/checkbox-inline/g" `ack-grep --type=html -l "checkbox inline"`
sed -i "s/radio inline/radio-inline/g" `ack-grep --type=html -l "radio inline"`
sed -i "s/input-prepend/input-group/g" `ack-grep --type=html -l "input-prepend"`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment