예제 #1
0
파일: InfoCommand.php 프로젝트: Rhoban/deps
 public function run(array $arguments)
 {
     $json = $this->deps->nearestJson();
     $package = new Package(dirname($json));
     $porcelain = count($arguments) && $arguments[0] == 'porcelain';
     if (!$porcelain) {
         Terminal::info("From {$json}\n\n");
         Terminal::bold("* project name: " . $package->getName() . "\n");
     }
     $dependencies = $package->getDependencies();
     if ($porcelain) {
         echo implode(':', $dependencies) . "\n";
     } else {
         if ($dependencies) {
             Terminal::bold("* dependencies:\n");
             foreach ($dependencies as $dep) {
                 echo "  - {$dep} ";
                 if ($this->deps->hasPackage($dep)) {
                     Terminal::success("(installed)");
                 } else {
                     Terminal::warning("(not installed)");
                 }
                 echo "\n";
             }
         } else {
             Terminal::bold("* no dependencies\n");
         }
     }
 }
예제 #2
0
 public function run(array $arguments)
 {
     if ($arguments) {
         foreach ($arguments as $dep) {
             $this->deps->build($dep);
         }
     } else {
         $json = $this->deps->nearestJson();
         $package = new Package(dirname($json));
         $dependencies = $package->getDependencies();
         foreach ($dependencies as $dep) {
             $this->deps->build($dep);
         }
         $this->deps->build($package->getName());
     }
     return true;
 }
예제 #3
0
 public function run(array $arguments)
 {
     if ($arguments) {
         foreach ($arguments as $dep) {
             $this->deps->install($dep);
         }
     } else {
         $json = $this->deps->nearestJson();
         $package = new Package(dirname($json));
         $dependencies = $package->getDependencies();
         if ($dependencies) {
             foreach ($dependencies as $dep) {
                 $this->deps->install($dep);
             }
         } else {
             Terminal::success("Nothing to do!\n");
         }
     }
     return true;
 }
예제 #4
0
 public function run(array $arguments)
 {
     $flags = "";
     if ($arguments) {
         foreach ($arguments as $dep) {
             if ($this->deps->hasPackage($dep)) {
                 $flags .= $this->cflags($this->deps->getPackage($dep));
             }
         }
     } else {
         $json = $this->deps->nearestJson();
         $package = new Package(dirname($json));
         $dependencies = $package->getDependencies();
         foreach ($dependencies as $dep) {
             if ($this->deps->hasPackage($dep)) {
                 $flags .= $this->cflags($this->deps->getPackage($dep));
             }
         }
     }
     Terminal::write($flags . "\n");
 }
예제 #5
0
 public function run(array $arguments)
 {
     $json = $this->deps->nearestJson();
     $package = new Package(dirname($json));
     echo "From {$json}\n\n";
     echo "* project name: " . $package->getName() . "\n";
     $dependencies = $package->getDependencies();
     if ($dependencies) {
         echo "* dependencies:\n";
         foreach ($dependencies as $dep) {
             echo "  - {$dep} ";
             if ($this->deps->hasPackage($dep)) {
                 echo "(installed)";
             } else {
                 echo "(not installed)";
             }
             echo "\n";
         }
     } else {
         echo "* no dependencies\n";
     }
 }