Пример #1
0
 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)
 {
     Terminal::info("Installed packages:\n");
     foreach ($this->deps->getPackages() as $package) {
         Terminal::bold('* ' . $package->getName() . "\n");
     }
 }
Пример #3
0
 public function run(array $arguments)
 {
     $remotes = $this->deps->getRemotes();
     $current = $remotes->getCurrent();
     Terminal::info("Remotes:\n");
     foreach ($remotes->getRemotes() as $remote => $addr) {
         if ($remote == $current) {
             Terminal::success("* {$remote} ({$addr})\n");
         } else {
             Terminal::bold("* {$remote} ({$addr})\n");
         }
     }
 }
Пример #4
0
 public function help()
 {
     Terminal::info("deps v0.1, dependencies manager\n");
     Terminal::info("\n");
     foreach ($this->commands as $command) {
         Terminal::bold($command->getName());
         Terminal::info(": usage: deps " . $command->getUsage() . "\n");
         Terminal::write('    ' . implode("\n    ", $command->getDescription()) . "\n\n");
     }
 }