Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #296 from HenrikWM/patch-1

Added support for deleting packages.
  • Loading branch information...
commit c4cdf9a0af79a88570d5bfcc77a1d3027267617d 2 parents bc4ba08 + 48254ec
@andrerom andrerom authored
Showing with 25 additions and 1 deletion.
  1. +25 −1 ezpm.php
View
26 ezpm.php
@@ -174,7 +174,7 @@ function helpHelp()
" export\n" .
" add\n" .
" set\n" .
-// " delete (del, remove, rm)\n" .
+ " delete (del, remove, rm)\n" .
" list\n" .
" info\n"
);
@@ -572,6 +572,11 @@ function resetCommandItem()
$commandItem['export-directory'] = $argv[$i];
}
}
+ else if ( $commandItem['command'] == 'delete' )
+ {
+ if ( $commandItem['name'] === false )
+ $commandItem['name'] = $arg;
+ }
}
}
}
@@ -656,6 +661,14 @@ function resetCommandItem()
helpHelp();
exit( 1 );
}
+ else if ( $commandItem['command'] == 'delete' )
+ {
+ if ( !$commandItem['name'] )
+ {
+ helpDelete();
+ exit( 1 );
+ }
+ }
else
{
help();
@@ -1028,6 +1041,17 @@ function resetCommandItem()
$alreadyCreated = true;
$createdPackages[$commandItem['name']] =& $package;
}
+ else if ( $command == 'delete' )
+ {
+ $package = eZPackage::fetch( $commandItem['name'] );
+ if ( $package )
+ {
+ $package->remove();
+ $cli->output( "Package " . $commandItem['name'] . " deleted." );
+ }
+ else
+ $cli->error( "Could not open package " . $commandItem['name'] );
+ }
}
$cli->output();
Please sign in to comment.
Something went wrong with that request. Please try again.