Skip to content

Commit 01d5f96

Browse files
committed
add deploy command
1 parent 8144957 commit 01d5f96

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

Mage/FPC/Console/Deploy.php

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,20 @@ protected function execute(
2828
) {
2929
$name = $input->getArgument(self::NAME_ARGUMENT);
3030
$option = $input->getOption(self::NAME_OPTION);
31-
$includeFile = dirname(__DIR__) . "/../FPC.php";
31+
$includeFile = dirname(__DIR__) . "/FPC.php";
32+
if (!file_exists($includeFile)) {
33+
$output->writeln("FPC.php not found in " . $includeFile);
34+
return 0;
35+
}
3236
$cmd = "grep -r \"FPC.php\" " . BP . "/pub/index.php" . " || sed -i '2 i include \"$includeFile\";' " . BP . "/pub/index.php";
3337
echo $cmd . "\n";
34-
exec($cmd, $output);
35-
var_dump($output);
38+
$output->writeln("Executing: " . $cmd);
39+
exec($cmd, $cmdOutput);
40+
if (count($cmdOutput) > 0) {
41+
$output->writeln("FPC.php was already deployed to pub/index.php");
42+
} else {
43+
$output->writeln("FPC.php deployed to pub/index.php");
44+
}
3645
return 0;
3746
}
3847

0 commit comments

Comments
 (0)