Skip to content

Commit 3d7b0b5

Browse files
smnandrekbond
authored andcommitted
[Icon] Console theme: reference the webite + improve icon readability
1 parent 554ebba commit 3d7b0b5

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

src/Icons/src/Command/ImportIconCommand.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
use Symfony\Component\Console\Attribute\AsCommand;
1515
use Symfony\Component\Console\Command\Command;
16+
use Symfony\Component\Console\Cursor;
1617
use Symfony\Component\Console\Input\InputArgument;
1718
use Symfony\Component\Console\Input\InputInterface;
1819
use Symfony\Component\Console\Output\OutputInterface;
@@ -64,7 +65,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
6465

6566
[$fullName, $prefix, $name] = $matches;
6667

67-
$io->comment(sprintf('Importing <info>%s</info>...', $fullName));
68+
$io->comment(sprintf('Importing %s...', $fullName));
6869

6970
try {
7071
$svg = $this->iconify->fetchSvg($prefix, $name);
@@ -75,13 +76,17 @@ protected function execute(InputInterface $input, OutputInterface $output): int
7576
continue;
7677
}
7778

79+
$cursor = new Cursor($output);
80+
$cursor->moveUp(2);
81+
7882
$this->registry->add(sprintf('%s/%s', $prefix, $name), $svg);
7983

8084
$license = $this->iconify->metadataFor($prefix)['license'];
8185

8286
$io->text(sprintf(
83-
"Imported <info>%s</info> (License: <href=%s>%s</>), render with <comment>{{ ux_icon('%s') }}</comment>.",
84-
$fullName,
87+
" <fg=bright-green;options=bold>✓</> Imported <fg=bright-white;bg=black>%s:</><fg=bright-magenta;bg=black;options>%s</> (License: <href=%s>%s</>). Render with: <comment>{{ ux_icon('%s') }}</comment>",
88+
$prefix,
89+
$name,
8590
$license['url'],
8691
$license['title'],
8792
$fullName,

src/Icons/tests/Integration/Command/ImportIconCommandTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function testCanImportIcon(): void
4646
$this->executeConsoleCommand('ux:icons:import uiw:dashboard')
4747
->assertSuccessful()
4848
->assertOutputContains('Importing uiw:dashboard')
49-
->assertOutputContains("Imported uiw:dashboard (License: MIT), render with {{ ux_icon('uiw:dashboard') }}")
49+
->assertOutputContains("Imported uiw:dashboard (License: MIT). Render with: {{ ux_icon('uiw:dashboard') }}")
5050
;
5151

5252
$this->assertFileExists($expectedFile);

0 commit comments

Comments
 (0)