Skip to content

Instantly share code, notes, and snippets.

@panudetjt
Created October 6, 2022 14:19
Show Gist options
  • Save panudetjt/1dd638f3f5e1e17dd87961d877378d3e to your computer and use it in GitHub Desktop.
Save panudetjt/1dd638f3f5e1e17dd87961d877378d3e to your computer and use it in GitHub Desktop.
This shell command change file .js to .jsx with only "JSX" file.
# https://github.com/vitejs/vite/discussions/3448#discussioncomment-1859773
find src -type f | grep "\.[jt]s$" | xargs -n1 grep -HE "^[^*\n]*(<\/?[a-zA-Z]*>)[\s\w]*$" | cut -d: -f1 | uniq | awk '{print "mv "$1" "$1"x"}' | sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment