Browse files

panda info works for local projects, too.

  • Loading branch information...
1 parent 9d68a70 commit c65536ed2197ae8088da14ad4ed78a3906b28a33 @timo committed Jan 5, 2013
Showing with 10 additions and 2 deletions.
  1. +1 −0 bin/panda
  2. +9 −2 lib/Panda.pm
View
1 bin/panda
@@ -50,6 +50,7 @@ sub search-projects($panda, $string) {
sub projectinfo($panda, @args) {
for @args -> $p {
my $x = $panda.ecosystem.get-project($p);
+ $x = $panda.project-from-local($p) unless $x;
if $x {
my $state = $panda.ecosystem.project-get-state($x);
say 'PROJECT LIST:';
View
11 lib/Panda.pm
@@ -61,17 +61,24 @@ class Panda is Pies {
self.announce: "{$p.key.name} depends on {$p.value.join(", ")}"
}
- method resolve($proj as Str, Bool :$nodeps, Bool :$notests) {
+ method project-from-local($proj as Str) {
if $proj.IO ~~ :d and "$proj/META.info".IO ~~ :f {
my $mod = from-json slurp "$proj/META.info";
$mod<source-type> = "local";
$mod<source-url> = $proj;
- my $p = Pies::Project.new(
+ return Pies::Project.new(
name => $mod<name>,
version => $mod<version>,
dependencies => $mod<depends>,
metainfo => $mod,
);
+ }
+ return False;
+ }
+
+ method resolve($proj as Str, Bool :$nodeps, Bool :$notests) {
+ my $p = self.project-from-local($proj);
+ if $p {
if $.ecosystem.get-project($p.name) {
self.announce: "Installing {$p.name} "
~ "from a local directory '$proj'";

0 comments on commit c65536e

Please sign in to comment.