小编Ter*_*how的帖子

rsync 排除文件夹不起作用?

我正在尝试将项目中的 yaml 文件复制到 dist 文件夹,保留结构。然而它是node_modules我不想要的复制。如何使用 rsync 排除以及为什么我的以下命令不起作用?

rsync -R --exclude=node_modules ./**/**.yaml dist

注意我已经尝试过变体等:

rsync -R --exclude= node_modules ./**/**.yaml dist
rsync -R --exclude 'node_modules' ./**/**.yaml dist
Run Code Online (Sandbox Code Playgroud)

我的文件夹结构:

projectroot
|--config/file.yaml
|
|--node_modules/somedir/somefile.yaml
|
|--src/somefolder/somefile.yaml
Run Code Online (Sandbox Code Playgroud)

我希望以上内容在我的 dist 中显示为:

dist
|--config/file.yaml
|  
|--src/somefolder/somefile.yaml
Run Code Online (Sandbox Code Playgroud)

rsync

6
推荐指数
1
解决办法
1万
查看次数

标签 统计

rsync ×1