Skip to content

Commit

Permalink
Change taxonomy import to make importing taxonomies/terms optional (#89)
Browse files Browse the repository at this point in the history
Co-authored-by: Jason Varga <[email protected]>
Fixes #81
  • Loading branch information
ryanmitchell authored Jan 31, 2023
1 parent c59235b commit 83d4616
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Commands/ImportTaxonomies.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ private function useDefaultRepositories()

private function importTaxonomies()
{
if (! $this->confirm('Do you want to import taxonomies?')) {
return;
}

$taxonomies = TaxonomyFacade::all();

$this->withProgressBar($taxonomies, function ($taxonomy) {
Expand All @@ -78,6 +82,10 @@ private function importTaxonomies()

private function importTerms()
{
if (! $this->confirm('Do you want to import terms?')) {
return;
}

$terms = TermFacade::all();
// Grab unique parent terms.
$terms = $terms->map->term()->unique();
Expand Down

0 comments on commit 83d4616

Please sign in to comment.