List Info

Thread: Re-rooting a directory tree for use with package task




Re-rooting a directory tree for use with package task
user name
2006-09-27 22:18:33
Hi,

Let's say I have two source trees in a project, source1 and
source2.   
Let's also say I want to create two packages when packing up
the app  
for distribution, one from each tree.  So, I'd like to
create one  
package with just the files under source1 and another with
just the  
files in source2.

What I'd like:

source1
  | - file1
    - file2
    - file3
source2
  | - file1
    - file2
    - file3
pkg
  | - SuperApp-component1
     | - file1
       - file2
       - file3
  | - SuperApp-component2
     | - file1
       - file2
       - file3


What I get:

pkg
  | - SuperApp-component1
     | - source1
        | - file1
         - file2
         - file3
  | - SuperApp-component2
     | - source2
        | - file1
         - file2
         - file3



What I've tried so far (simplified):

Rake::PackageTask.new("SuperApp-component1") do
|p|
   p.package_files = FileList["rails/**/*"]
end

- and -

Rake::PackageTask.new("SuperApp-component1") do
|p|
   p.package_files =
FileList["rails/**/*"].pathmap("%-1d")
end

The first gets the files, the second does not, of course,
but I  
though i'd try ...

Is there anyway to re-root the copied files in a package
task,  
subtracting the parent directory? I could of course copy the
files to  
a temporary directory first, but I wondered if there is a
way to do  
it with the package task.

Best,
John






_______________________________________________
Rake-devel mailing list
Rake-develrubyforge.org
http
://rubyforge.org/mailman/listinfo/rake-devel
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )