Skip to content

Commit

Permalink
Merge pull request #4837 from mhsdesign/bugfix/nodeTypesCommandContro…
Browse files Browse the repository at this point in the history
…ller-followup

BUGFIX: Followup `nodeTypes:show` with `--path` to primitive value
  • Loading branch information
mhsdesign committed Feb 6, 2024
2 parents 28baf4c + 751518c commit 1dab57e
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,14 @@ public function showCommand(string $nodeTypeName, string $path = '', int $level
$this->quit();
}

$configuration = $path
? self::truncateArrayAtLevel($nodeType->getConfiguration($path), $level)
: [$nodeTypeName => self::truncateArrayAtLevel($nodeType->getFullConfiguration(), $level)];
if (empty($path)) {
$configuration = [$nodeTypeName => self::truncateArrayAtLevel($nodeType->getFullConfiguration(), $level)];
} else {
$configuration = $nodeType->getConfiguration($path);
if (is_array($configuration)) {
$configuration = self::truncateArrayAtLevel($configuration, $level);
}
}

$yaml = Yaml::dump($configuration, 99);

Expand Down

0 comments on commit 1dab57e

Please sign in to comment.