Skip to content

Commit 4499b6f

Browse files
author
Anton Evers
committed
Don't display deploy strategy and execution time when only changeing the version number
1 parent fbc9db3 commit 4499b6f

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

app/code/Magento/Deploy/Service/DeployStaticContent.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public function deploy(array $options)
8181
$this->versionStorage->save($version);
8282

8383
if ($this->getRefreshContentVersionOnly($options)) {
84-
$this->logger->warning(PHP_EOL . "New content version: " . $version);
84+
$this->logger->warning("New content version: " . $version);
8585
return;
8686
}
8787

@@ -148,7 +148,6 @@ private function getProcessesAmount(array $options)
148148
private function getRefreshContentVersionOnly(array $options)
149149
{
150150
return isset($options[Options::REFRESH_CONTENT_VERSION_ONLY])
151-
? (bool)$options[Options::REFRESH_CONTENT_VERSION_ONLY]
152-
: false;
151+
&& $options[Options::REFRESH_CONTENT_VERSION_ONLY];
153152
}
154153
}

setup/src/Magento/Setup/Console/Command/DeployStaticContentCommand.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,11 +120,15 @@ protected function execute(InputInterface $input, OutputInterface $output)
120120

121121
$options = $input->getOptions();
122122
$options[Options::LANGUAGE] = $input->getArgument(Options::LANGUAGES_ARGUMENT) ?: ['all'];
123+
$refreshOnly = isset($options[Options::REFRESH_CONTENT_VERSION_ONLY])
124+
&& $options[Options::REFRESH_CONTENT_VERSION_ONLY];
123125

124126
$verbose = $output->getVerbosity() > 1 ? $output->getVerbosity() : OutputInterface::VERBOSITY_VERBOSE;
125127

126128
$logger = $this->consoleLoggerFactory->getLogger($output, $verbose);
127-
$logger->alert(PHP_EOL . "Deploy using {$options[Options::STRATEGY]} strategy");
129+
if (!$refreshOnly) {
130+
$logger->alert(PHP_EOL . "Deploy using {$options[Options::STRATEGY]} strategy");
131+
}
128132

129133
$this->mockCache();
130134

@@ -135,7 +139,9 @@ protected function execute(InputInterface $input, OutputInterface $output)
135139

136140
$deployService->deploy($options);
137141

138-
$logger->alert(PHP_EOL . "Execution time: " . (microtime(true) - $time));
142+
if (!$refreshOnly) {
143+
$logger->alert(PHP_EOL . "Execution time: " . (microtime(true) - $time));
144+
}
139145

140146
return \Magento\Framework\Console\Cli::RETURN_SUCCESS;
141147
}

0 commit comments

Comments
 (0)