Rename .js files to .ts
find app/src -name "*.js" -exec sh -c 'mv "$0" "${0%.js}.ts"' {} \; |
This comment has been minimized.
This comment has been minimized.
Thanks, It works like magic~ |
This comment has been minimized.
This comment has been minimized.
Works perfectly |
This comment has been minimized.
This comment has been minimized.
+1 |
This comment has been minimized.
This comment has been minimized.
Will this overwrite existing files? |
This comment has been minimized.
This comment has been minimized.
+1 |
This comment has been minimized.
This comment has been minimized.
works :) |
This comment has been minimized.
This comment has been minimized.
Nice |
This comment has been minimized.
This comment has been minimized.
Thanks :) |
This comment has been minimized.
This comment has been minimized.
Thanks for the gist. |
This comment has been minimized.
This comment has been minimized.
Thanks |
This comment has been minimized.
This comment has been minimized.
Thank you kindly |
This comment has been minimized.
This comment has been minimized.
Handy, but if you are using files in version control use:
|
This comment has been minimized.
This comment has been minimized.
Beautiful! |
This comment has been minimized.
This comment has been minimized.
great! |
This comment has been minimized.
This comment has been minimized.
thanks, works perfectly. |
This comment has been minimized.
This comment has been minimized.
FYI: If you want to change jsx to tsx also, the command would become as follows |
This comment has been minimized.
This comment has been minimized.
Thanks! |
This comment has been minimized.
This comment has been minimized.
How to rename .ts to .js? |
This comment has been minimized.
This comment has been minimized.
Nice! I needed to pre-filter to only certain folders using globs:
Run a test first with just the find:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This comment has been minimized.
thanks it works