Skip to content

Instantly share code, notes, and snippets.

View Dev-Zhao's full-sized avatar
😎
Working on something cool

Charlie Dev-Zhao

😎
Working on something cool
  • Toronto, Canada
View GitHub Profile
@parties
parties / renameReactJsToJsx.sh
Last active November 15, 2024 23:32
rename all *.js files containing React markup to *.jsx
# finds all *.js files that have either `</` or `/>` tags in them and renames them to *.jsx
find ./src -type f -name '*.js' -not -name '*.jsx' -not -name '*.ejs' -exec bash -c 'grep -l -E "</|/>" "$0"' {} \; -exec bash -c 'mv "$0" "${0%.js}.jsx"' {} \;