Skip to content

Commit

Permalink
do not ask to execute "yarn routes:dump" if jsrouting-bundle is not i…
Browse files Browse the repository at this point in the history
…nstalled.
  • Loading branch information
indivisualvj committed Nov 13, 2024
1 parent 23664e0 commit fb6c817
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/Task/DumpRoutes.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class DumpRoutes extends AbstractSubroutine

public function __invoke()
{
while(true) {
while($this->isFosRouting()) {
$option = $this->askYesNo($this->input, $this->output, 'dump routes?', self::ANSWER_YES);

if (strtolower($option) === self::ANSWER_NO) {
Expand All @@ -22,4 +22,13 @@ public function __invoke()
}
}
}

private function isFosRouting(): bool
{
if (getcwd() === false) {
return false;
}
$path = sprintf('%s/vendor/friendsofsymfony/jsrouting-bundle', getcwd());
return file_exists($path);
}
}

0 comments on commit fb6c817

Please sign in to comment.