8000 [TwigBundle] Fix return code in LintComand · MattKetmo/symfony@df5590e · GitHub
[go: up one dir, main page]

8000
Skip to content

Commit df5590e

Browse files
author
alexandresalome
committed
[TwigBundle] Fix return code in LintComand
1 parent 604a79a commit df5590e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Symfony/Bundle/TwigBundle/Command/LintCommand.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,14 +87,18 @@ protected function execute(InputInterface $input, OutputInterface $output)
8787
$files = Finder::create()->files()->in($dir)->name('*.twig');
8888
}
8989

90+
$error = false;
9091
foreach ($files as $file) {
9192
try {
9293
$twig->parse($twig->tokenize(file_get_contents($file), (string) $file));
9394
$output->writeln(sprintf("<info>OK</info> in %s", $file));
9495
} catch (\Twig_Error $e) {
9596
$this->renderException($output, $file, $e);
97+
$error = true;
9698
}
9799
}
100+
101+
return $error ? 1 : 0;
98102
}
99103

100104
protected function renderException(OutputInterface $output, $file, \Twig_Error $exception)

0 commit comments

Comments
 (0)
0