Skip to content

Commit

Permalink
update woo:validate-zip description and output messages
Browse files Browse the repository at this point in the history
  • Loading branch information
rcstr committed May 6, 2024
1 parent c9c5b43 commit b8178c8
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/src/Commands/WooValidateZipCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,20 @@ class WooValidateZipCommand extends Command {

protected function configure() {
$this
->setDescription( 'Run the validate-zip command.' )
->setHelp( 'Run the validate-zip command.' )
->addArgument( 'zip', InputArgument::REQUIRED, 'The path to the zip file.' );
->setDescription( 'Validate a local ZIP file\'s content.' )
->setHelp( 'If invalid content or wrong format is found in ZIP file, an error will be shown.' )
->addArgument( 'path', InputArgument::REQUIRED, 'The ZIP file path' );
}

protected function execute( InputInterface $input, OutputInterface $output ): int {
try {
$zip_file = $input->getArgument( 'zip' );
$zip_file = $input->getArgument( 'path' );

ZIP::validate_zip( $zip_file );

$output->writeln( 'Zip file is valid.' );
$output->writeln( '<info>Zip file content is valid.</info>' );
} catch ( \Exception $e ) {
$output->writeln( 'Error: ' . $e->getMessage() );
$output->writeln( sprintf( '<error>An error occurred while validating the ZIP file. Error: %s</error>', $e->getMessage() ) );

return Command::FAILURE;
}
Expand Down

0 comments on commit b8178c8

Please sign in to comment.