Skip to content

Commit f9175a7

Browse files
authored
fix: ensure theme codes are indexed correctly in commands (#149)
1 parent 3b4cfca commit f9175a7

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/Console/Command/Theme/BuildCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ protected function executeCommand(InputInterface $input, OutputInterface $output
7070

7171
if (empty($themeCodes)) {
7272
$themes = $this->themeList->getAllThemes();
73-
$options = array_map(fn($theme) => $theme->getCode(), $themes);
73+
$options = array_values(array_map(fn($theme) => $theme->getCode(), $themes));
7474

7575
// Check if we're in an interactive terminal environment
7676
if (!$this->isInteractiveTerminal($output)) {

src/Console/Command/Theme/CleanCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ private function getAllThemeCodes(): ?array
141141
private function selectThemesInteractively(OutputInterface $output): ?array
142142
{
143143
$themes = $this->themeList->getAllThemes();
144-
$options = array_map(fn($theme) => $theme->getCode(), $themes);
144+
$options = array_values(array_map(fn($theme) => $theme->getCode(), $themes));
145145

146146
if (!$this->isInteractiveTerminal($output)) {
147147
$this->displayAvailableThemes($themes);

src/Console/Command/Theme/TokensCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ private function selectTheme(?string $themeCode): ?string
106106
}
107107

108108
$themes = $this->themeList->getAllThemes();
109-
$options = array_map(fn($theme) => $theme->getCode(), $themes);
109+
$options = array_values(array_map(fn($theme) => $theme->getCode(), $themes));
110110

111111
$themeCodePrompt = new SearchPrompt(
112112
label: 'Select theme to generate tokens for',

0 commit comments

Comments
 (0)