Skip to content

Instantly share code, notes, and snippets.

@dx7
Last active December 15, 2015 17:29
Show Gist options
  • Save dx7/5297012 to your computer and use it in GitHub Desktop.
Save dx7/5297012 to your computer and use it in GitHub Desktop.
Adiciona -*- coding: utf-8 -*- em todos os arquivos .rb e .rake
Remove comentários antigos
find . -iname "*.rb" -print0 -o -iname "*.rake" -print0 | xargs -0 -I {} sed -i "" -E -e "/^#.*coding.*utf-8.*$/d" {}
Adiciona novo magic encoding comment
find . -iname "*.rb" -print0 -o -iname "*.rake" -print0 | xargs -0 -I {} gsed -i '1i# -*- coding: utf-8 -*-' {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment