【问题标题】:grunt.file write/copy with permissionsgrunt.file 具有权限的写入/复制
【发布时间】:2015-06-20 22:34:06
【问题描述】:

有没有办法在 grunt.file.copy(...) 期间指定文件的权限,除了在复制完成后使用 'fs.chmod'?

否则我将不得不要求整个“fs”模块,只是为了更改权限。开销会很大吗?

【问题讨论】:

    标签: gruntjs grunt-contrib-copy gruntfile


    【解决方案1】:

    很遗憾,grunt.file.copy 没有提供任何选项。

    但是 grunt copy 任务(来自grunt-contrib-copy)有一个选项(options.mode,请参阅https://github.com/gruntjs/grunt-contrib-copy#mode)。

    【讨论】:

    • grunt-contrib-copy 会在 linux 和 windows 机器上以一致的方式工作吗?
    • 应该,它在幕后使用 Node 'fs'。
    猜你喜欢
    • 2012-03-06
    • 2021-05-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-02-28
    • 2019-04-11
    • 2010-10-08
    相关资源
    最近更新 更多