Nuby Rake questions about FileList or File task

B

Bob Archer

Hello all,

=20

It was recommended that I post rake questions here. I couldn't find a
rake specific mail list. If there is one, please point me to it.

=20

I am creating a rake script and my .Net app test projects have
app.config.template files that I want to rename to app.config but only
if app.config doesn't already exist.

=20

So, I am doing the following:

=20

FileList['**/app.config.template'].each do |src|

cp src,
"#{File.dirname(src)}/app.config" unless
File::exist?("#{File.dirname(src)}/app.config")

end =20

=20

It does work.. but seems like I should be able to do this with a rule or
File task.. but I can't figure out how. Should I just stick with the
above?

=20

Also, what is the order that stuff that is in the rakefile but not in a
task will run. If I want this to happen no matter what task is run
should I put it before any tasks, or does it not matter? Or, should I
really put the above into my compile task?

=20

Finally, I am confused about a File task. Does this run all the time, or
does it need to be called?

=20

Thanks,

BOb

=20

=20
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,012
Latest member
RoxanneDzm

Latest Threads

Top