-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBuild.pm
More file actions
34 lines (25 loc) · 979 Bytes
/
Copy pathBuild.pm
File metadata and controls
34 lines (25 loc) · 979 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# Since the p6doc pod is now moved from 'lib' to 'doc' in the distribution we
# need this to install pod under .../share/perl6/doc
# This fixes p6doc command line use.
use Panda::Common;
use Panda::Builder;
use Shell::Command;
use File::Find;
use Panda::Installer;
class Build is Panda::Builder {
method build($workdir) {
my $dest-pref = Panda::Installer.new.default-prefix() ~ '/../doc';
my $docdir = IO::Path.new("$workdir/doc").abspath; # An OS independent version
my @files = find(dir => $docdir, type => 'file').list;
for @files -> $file {
next if $file ~~ /'HomePage.pod'$/;
my $dest = $file;
$dest = $dest-pref ~ $dest.split($docdir)[1];
my $dest-dir = $dest.IO.dirname;
mkpath $dest-dir unless $dest-dir.IO.d;
my $relative = $*SPEC.abs2rel($file, $workdir);
note "Copying $relative to $dest";
cp($file, $dest);
}
}
}