1
0
Fork 0

Adjust output for create project, refs #724

pull/726/head
Jordi Boggiano 2012-05-22 16:06:22 +02:00
parent 713309b38c
commit 99513ba52b
2 changed files with 3 additions and 7 deletions

View File

@ -24,7 +24,6 @@ use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Composer\Json\JsonFile;
use Composer\Util\Filesystem;
use Composer\Util\RemoteFilesystem;
use Composer\Package\Version\VersionParser;
@ -118,10 +117,7 @@ EOT
}
}
$fs = new Filesystem();
$prettyDirectory = rtrim($fs->isAbsolutePath($directory) ? $fs->findShortestPath(getcwd(), $directory, true) : $directory, '\\/') . '/';
$io->write('<info>Installing ' . $package->getName() . ' (' . VersionParser::formatVersion($package) . ') in '.$prettyDirectory.'</info>', true);
$io->write('<info>Installing ' . $package->getName() . ' (' . VersionParser::formatVersion($package, false) . ')</info>', true);
$projectInstaller = new ProjectInstaller($directory, $dm);
$projectInstaller->install(new InstalledFilesystemRepository(new JsonFile('php://memory')), $package);

View File

@ -59,13 +59,13 @@ class VersionParser
return $stability === 'rc' ? 'RC' : $stability;
}
static public function formatVersion(PackageInterface $package)
static public function formatVersion(PackageInterface $package, $truncate = true)
{
if (!$package->isDev() || !in_array($package->getSourceType(), array('hg', 'git'))) {
return $package->getPrettyVersion();
}
return $package->getPrettyVersion().' '.substr($package->getSourceReference(), 0, 6);
return $package->getPrettyVersion() . ' ' . ($truncate ? substr($package->getSourceReference(), 0, 6) : $package->getSourceReference());
}
/**