mirror of
https://github.com/php/php-src.git
synced 2025-08-18 23:18:56 +02:00
Added "pear package -n" (only output the created package file name)
This commit is contained in:
parent
297ee300de
commit
3788b31b0e
1 changed files with 12 additions and 2 deletions
|
@ -89,9 +89,11 @@ class PEAR_Command_Package extends PEAR_Command_Common
|
||||||
{
|
{
|
||||||
switch ($command) {
|
switch ($command) {
|
||||||
case 'package':
|
case 'package':
|
||||||
return array('[<package.xml>]',
|
return array('[-n] [<package.xml>]',
|
||||||
'Creates a PEAR package from its description file (usually '.
|
'Creates a PEAR package from its description file (usually '.
|
||||||
'named as package.xml)');
|
"named as package.xml)\n".
|
||||||
|
" -n Return only the created package file name. Useful for\n".
|
||||||
|
" shell script operations.");
|
||||||
case 'package-list':
|
case 'package-list':
|
||||||
return array('<pear package>',
|
return array('<pear package>',
|
||||||
'List the contents of a PEAR package');
|
'List the contents of a PEAR package');
|
||||||
|
@ -146,6 +148,14 @@ class PEAR_Command_Package extends PEAR_Command_Common
|
||||||
$result = $packager->Package($pkginfofile, $compress);
|
$result = $packager->Package($pkginfofile, $compress);
|
||||||
$output = ob_get_contents();
|
$output = ob_get_contents();
|
||||||
ob_end_clean();
|
ob_end_clean();
|
||||||
|
if (PEAR::isError($result)) {
|
||||||
|
$failmsg = $result;
|
||||||
|
}
|
||||||
|
// Don't want output, only the package file name just created
|
||||||
|
if (isset($options['n'])) {
|
||||||
|
$this->ui->displayLine($result);
|
||||||
|
return;
|
||||||
|
}
|
||||||
$lines = explode("\n", $output);
|
$lines = explode("\n", $output);
|
||||||
foreach ($lines as $line) {
|
foreach ($lines as $line) {
|
||||||
$this->ui->displayLine($line);
|
$this->ui->displayLine($line);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue