-
Notifications
You must be signed in to change notification settings - Fork 18
Added --watch option to ibexa:encore:compile #1671
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
9c2a46e
to
84aab74
Compare
@@ -77,7 +83,8 @@ protected function getFrontendConfigPath(string $configName): string | |||
|
|||
protected function execute(InputInterface $input, OutputInterface $output): int | |||
{ | |||
$timeout = (float)$input->getOption('timeout'); | |||
$watch = $input->getOption('watch'); | |||
$timeout = $watch ? null : (float)$input->getOption('timeout'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If someone passes --timeout
, but we silently discard it due to --watch
, it should raise an error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In 84aab74...a220c2d I implemented the error when both options are used at the same time --watch --timeout 123
.
To be able to detected if the user passed the --timeout
option, I had to remove its default value from definition.
|
Description:
Allow to have
yarn encore dev --watch
feature without changing habitual command.php bin/console ibexa:encore:compile --watch
runs until killed, it watches the assets, and rebuilds them on change.About errors:
php bin/console ibexa:encore:compile --watch --timeout 123
throws errorWatch mode can't be used with a timeout.
php bin/console ibexa:encore:compile --timeout
still throws errorThe "--timeout" option requires a value.
php bin/console ibexa:encore:compile --timeout abc
still throws errorTimeout value has to be an integer.
For QA:
Documentation: