[英]Recursively select file in mac - need to prettier all files in directory
I am following this medium post . 我正在关注这篇中等职位 。
Running the command prettier --write ./src/**/*.{js,jsx,scss}
works perfectly fine on windows machine. 在Windows机器上运行命令
prettier --write ./src/**/*.{js,jsx,scss}
可以很好地工作。
However, when using Mac machine, this command doesn't go recursively on files that present on sub-folders. 但是,在使用Mac计算机时,该命令不会递归地存在于子文件夹中的文件上。
What is the difference between windows and mac on this? Windows和Mac之间有什么区别?
You could use find with -exec, like so 您可以将find与-exec一起使用,就像这样
find src -iname \*.js -or -iname \*.jsx -exec prettier --write {} \;
The arguments: 参数:
Before you execute it, you could prepend echo to preview what commands will be running, like so 在执行之前,您可以在echo之前添加预览以预览将要运行的命令,如下所示
find src -iname \*.js -or -iname \*.jsx -exec echo prettier --write {} \;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.