Skip to content

Instantly share code, notes, and snippets.

@joeswann
Last active June 14, 2018 03:29
Show Gist options
  • Save joeswann/e541b5ab51b9d4b65d55af2f57e0c47a to your computer and use it in GitHub Desktop.
Save joeswann/e541b5ab51b9d4b65d55af2f57e0c47a to your computer and use it in GitHub Desktop.
[rails_engine_rename.sh]
# Note, works best if your engine name isn't reserved
# Rename in files
find ~/www/rails/engines/old_engine/ -type f | xargs sed -i s/Old/New/g
find ~/www/rails/engines/old_engine/ -type f | xargs sed -i s/old/new/g
# Remove -n to run command
find ~/www/rails/engines/old_engine -type f -name '*' -print0 | xargs -0 rename -n 's/(.*)old\.(.*)/$new\.$2/g';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment