Skip to content

Commit 6c6c2e3

Browse files
committed
output when there is output
1 parent bf2194d commit 6c6c2e3

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

web/reload-fixtures.php

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,26 @@
11
<pre>
22
<?php
33

4-
function runCommand($command)
4+
function runCommand($command, $shouldHaveOutput = true)
55
{
66
$output = $return_var = null;
77
echo "Running: $command\n";
88
exec($command, $output, $return_var);
99

10-
if (empty($output) || !is_array($output)) {
11-
echo 'Fixtures could not be loaded: '.var_export($return_var, true);
12-
exit(1);
13-
}
14-
15-
echo "Output:\n";
16-
foreach ($output as $line) {
17-
echo $line."\n";
10+
if ($shouldHaveOutput) {
11+
if (empty($output) || !is_array($output)) {
12+
echo 'Fixtures could not be loaded: '.var_export($return_var, true);
13+
exit(1);
14+
}
15+
echo PHP_EOL;
16+
echo "Output:\n";
17+
foreach ($output as $line) {
18+
echo $line."\n";
19+
}
1820
}
1921
}
2022

21-
runCommand('rm -rf app/cache/prod');
23+
runCommand('rm -rf app/cache/prod', false);
2224
runCommand(__DIR__.'/../bin/console --env=prod doctrine:phpcr:init:dbal --drop --force');
2325
runCommand(__DIR__.'/../bin/console --env=prod doctrine:phpcr:repository:init');
2426
runCommand(__DIR__.'/../bin/console -v --env=prod doctrine:phpcr:fixtures:load -n');

0 commit comments

Comments
 (0)