Created
December 21, 2022 15:00
-
-
Save adipasquale/df1a45ccbba50635f0cdf925a1492caa to your computer and use it in GitHub Desktop.
VSCode command to convert html.erb to haml
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
# scripts/html2haml.sh | |
ls $1 | sed 'p;s/.erb$/.haml/' | xargs -n2 bundle exec html2haml --ruby19-attributes -E utf-8:utf-8 | |
ls $1 | sed 's/.erb$/.haml/' | xargs sed -i '' 's/é/é/g' | |
ls $1 | sed 's/.erb$/.haml/' | xargs sed -i '' 's/è/è/g' | |
ls $1 | sed 's/.erb$/.haml/' | xargs sed -i '' 's/ /\ /g' | |
ls $1 | sed 's/.erb$/.haml/' | xargs sed -i '' 's/«/«/g' | |
ls $1 | sed 's/.erb$/.haml/' | xargs sed -i '' 's/»/»/g' | |
ls $1 | sed 's/.erb$/.haml/' | xargs sed -i '' 's/à/à/g' | |
ls $1 | sed 's/.erb$/.haml/' | xargs sed -i '' 's/’/ʼ/g' | |
ls $1 | sed 's/.erb$/.haml/' | xargs sed -i '' 's/fi/fi/g' | |
ls $1 | sed 's/.erb$/.haml/' | xargs sed -i '' 's/œ/œ/g' | |
ls $1 | sed 's/.erb$/.haml/' | xargs sed -i '' 's/î/î/g' | |
ls $1 | sed 's/.erb$/.haml/' | xargs sed -i '' 's/\À/À/g' | |
# ls $1 | sed 's/.erb$/.haml/' | xargs sed -i '' 's/à/à/g' |
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
// VSCode Key Binding | |
{ | |
"key": "ctrl+shift+h", | |
"command": "workbench.action.terminal.sendSequence", | |
"args": { | |
"text": "./scripts/html2haml.sh ${file}\u000D" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment