Skip to content

Commit 2a8a6ab

Browse files
Merge pull request #394 from symfony-cmf/fix_reload
output when there is output
2 parents 293d175 + d9ad656 commit 2a8a6ab

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

web/reload-fixtures.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,28 @@
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 (!$shouldHaveOutput) {
11+
return;
12+
}
13+
1014
if (empty($output) || !is_array($output)) {
1115
echo 'Fixtures could not be loaded: '.var_export($return_var, true);
1216
exit(1);
1317
}
14-
18+
echo PHP_EOL;
1519
echo "Output:\n";
1620
foreach ($output as $line) {
1721
echo $line."\n";
1822
}
1923
}
2024

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

0 commit comments

Comments
 (0)