Created
March 14, 2024 08:24
-
-
Save mhenrixon/c0de3e7a48cc89d9827d1e1484d3cfed to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/usr/bin/env bash | |
# Rename all files with "_component" in the name to remove "_component" | |
directory="app/views/components" | |
find "$directory" -type f -name "*_component*" | while read file; do | |
dir=$(dirname "$file") | |
name=$(basename "$file") | |
new_name=${name/_component/} | |
echo "moving $file to $dir/$new_name" | |
mv "$file" "$dir/$new_name" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment