简体   繁体   English

如何使用grunt重命名文件夹名称?

[英]How can I rename a folder name using grunt?

There is a folder say... 有一个文件夹说...

vendor/jquery-1.10.0 供应商/jquery-1.10.0

How can I write a grunt task such I can strip off the version off of the dependency name? 如何编写艰巨的任务,以便可以从依赖项名称中删除版本?

ie I want just vendor/jquery 即我只想要供应商/ jQuery

This can be the last task the the grunt list of tasks. 这可能是任务列表中的最后一个任务。 I do not want to do this while copy is happening. 不想这样做,而副本发生。

The first results on searching for grunt rename folder show the grunt-contrib-rename npm. 搜索grunt重命名文件夹的第一个结果显示grunt-contrib-rename npm。
You may want to check that out. 您可能要检查一下。

I don't know what is your flow, but maybe you should consider making a symlink instead of renaming the folder every time, as @meder suggested. 我不知道您的流程如何,但也许您应该考虑建立符号链接,而不是每次都按@meder的建议重命名文件夹。
Either you create one manually and don't care about renaming your folder any more, or use grunt-contrib-symlink to create it as in a task. 您可以手动创建一个文件夹,而不必再为文件夹重命名,也可以像在任务中一样使用grunt-contrib-symlink来创建它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM