I want to copy some files with Rake, but compared to Ant this is kind of clumsy and my implementation is a bit stupid.
The source files have read only flags, I wish to copy files with write access (ant did this automatically).
If the target is not newer than the source, then I don’t want to copy.
Here is my current code:
source = c:\perforce\read\only\lame
target = c:\deploy\files\stop\writing\read\only
FileList[source].each do |src|
cp source, src.sub(source, target), :verbose => true
chmod 0644, src.sub(source,target)
end
Ant would be
<copy todir="target" verbose="true">
<fileset dir="source">
<include name="*" />
</fileset>
</copy>
I would use a bit different approach:
But You were asking for: