Created
September 11, 2010 16:39
-
-
Save tadzik/575338 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use File::Copy; | |
use File::Find; | |
use File::Mkdir; | |
module Module::Install; | |
sub install(Str $dir = '.', Str $dest = "%*ENV<HOME>/.perl6/") is export { | |
if $*VM<config><osname> ne 'MSWin32' | |
&& "$dir/Makefile".IO ~~ :f { | |
run 'make install' and die "'make install' failed"; | |
} else { | |
for find(dir => "$dir/lib", name => /[\.pm6?$] | [\.pir$]/).list -> $pmfile { | |
say "toying with $pmfile"; | |
my $target-dir = $pmfile.dir.subst(/\.\//, $dest); | |
say "target dir is $target-dir"; | |
mkdir $target-dir, :p; | |
say "Starting copying, time is {time}"; | |
cp ~$pmfile, "$target-dir/{$pmfile.name}"; | |
say "Done copying, time is {time}"; | |
} | |
} | |
} | |
# vim: ft=perl6 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment