Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix GH-6
  • Loading branch information
Tadeusz Sośnierz committed Jun 2, 2013
1 parent e0474ee commit d3042b8
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions lib/Panda.pm
Expand Up @@ -61,6 +61,22 @@ class Panda {
return False;
}

method project-from-git($proj as Str, $tmpdir) {
if $proj ~~ m{^git\:\/\/} {
mkpath $tmpdir;
$.fetcher.fetch($proj, $tmpdir);
my $mod = from-json slurp "$tmpdir/META.info";
$mod<source-url> = $tmpdir;
return Panda::Project.new(
name => $mod<name>,
version => $mod<version>,
dependencies => $mod<depends>,
metainfo => $mod,
);
}
return False;
}

method install(Panda::Project $bone, $nodeps,
$notests, $isdep as Bool) {
my $dir = tmpdir();
Expand Down Expand Up @@ -109,7 +125,10 @@ class Panda {
}

method resolve($proj as Str is copy, Bool :$nodeps, Bool :$notests) {
my $tmpdir = tmpdir();
LEAVE { rm_rf $tmpdir if $tmpdir.IO.e }
my $p = self.project-from-local($proj);
$p ||= self.project-from-git($proj, $tmpdir);
if $p {
if $.ecosystem.get-project($p.name) {
self.announce: "Installing {$p.name} "
Expand Down

0 comments on commit d3042b8

Please sign in to comment.