[英]How to `chmod -R +w` with Ant, files and folders?
I'd like to do the equivalent of a chmod -R +w foo/
in an Ant build script. 我想在Ant构建脚本中执行相当于
chmod -R +w foo/
的操作。
So far I'm using this: 到目前为止我正在使用这个:
<chmod perm="g+w">
<dirset dir="${basedir}/foo">
</dirset>
<fileset dir="${basedir}/foo">
</fileset>
</chmod>
Is there a neater way to write that to include files and folders recursively ? 是否有一种更简洁的方式来编写它以递归方式包含文件和文件夹?
The following does work: 以下工作:
<chmod file="${basedir}/foo/**" perm="g+w" type="both"/>
Credits shared with the OP. 积分与OP共享。
Here's the gradle version : 这是gradle版本:
task fixPermissions << {
ant.chmod(dir:"$rootDir/foo", perm:"g+w", includes:"**/*")
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.