Skip to content
This repository has been archived by the owner on Mar 22, 2021. It is now read-only.

Allow running the command once again #28

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Magento\Framework\Exception\LocalizedException;
use Magento\UrlRewrite\Service\V1\Data\UrlRewrite;
use Magento\UrlRewrite\Model\UrlPersistInterface;
use Magento\CatalogUrlRewrite\Model\ProductUrlRewriteGenerator;
Expand Down Expand Up @@ -69,8 +70,11 @@ protected function configure()

public function execute(InputInterface $inp, OutputInterface $out)
{
if (!$this->state->getAreaCode()) {

try {
$this->state->setAreaCode('adminhtml');
} catch (LocalizedException $e) {
$out->writeln("Area code has already been set. Skipping");
}

$store_id = $inp->getOption('store');
Expand Down