Skip to content

Commit 94c9446

Browse files
committed
Uses runSoftwareUpdate method in DownloadCommand to enforce a timeout
1 parent a16a8a0 commit 94c9446

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

src/Command/DownloadCommand.php

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,18 @@ protected function execute(InputInterface $input, OutputInterface $output)
2424
foreach ($Updates as $macUpdate)
2525
{
2626
$this->io()->info('Downloading '.$macUpdate->getName(), 50);
27-
exec(sprintf('%s --no-scan --download "%s"', $this->getSoftwareUpdate(), $macUpdate->getId()), $output, $retval);
2827

29-
if (0 !== $retval)
28+
$info = [];
29+
$cmd = sprintf('%s --no-scan --download "%s"', $this->getSoftwareUpdate(), $macUpdate->getId());
30+
if (!$this->runSoftwareUpdate($cmd, $info))
3031
{
31-
$errors = true;
3232
$this->io()->error('[ERROR]');
33-
foreach ($output as $line)
34-
{
35-
if ('Software Update Tool' != $line && !empty($line))
33+
34+
foreach($info as $line)
3635
{
3736
$this->io()->writeln(' '.$line);
3837
}
3938
}
40-
}
4139
else
4240
{
4341
$this->io()->successln('[SUCCESS]');

0 commit comments

Comments
 (0)