XF 2.0 Run CLI command programmatically and bypass confirmation

Jake B.

Well-known member
I'm adding in a command to make our lives much easier with multiple developers and git so we can run one command that will run xf-designer:import for all styles and xf:addon-rebuild (or xf:addon-upgrade when necessary) for all add-ons to update the style properties, templates, etc within our dev environments without having to manually do it for each add-on/style installed, but currently I'm stuck with a confirmation on each add-on for xf:addon-rebuild so you end up having to enter "Yes" 10 or so times, which gets annoying. Hopefully there is a way to bypass this that I'm missing, otherwise I'll probably just extend the command and remove that confirmation from our version of it.

This is what I'm using to run the xf:addon-rebuild:

Code:
$command = $this->getApplication()->find('xf:addon-rebuild');
$childInput = new ArrayInput([
    'command' => 'xf:addon-rebuild',
    'id' => $addOn->getAddOnId(),
]);
$command->run($childInput, $output);
 
Top Bottom