check if cache is writable

This commit is contained in:
Uwe Steinmann 2025-11-16 17:14:16 +01:00
parent fec5875f07
commit 886a5eaf62
2 changed files with 10 additions and 0 deletions

View File

@ -58,6 +58,11 @@ class DownloadextensionCommand extends Command
$output->writeln("<comment>Using configuration from '".$settings->_configFilePath."'.</comment>", OutputInterface::VERBOSITY_VERBOSE);
if (!is_writable($settings->_cacheDir)) {
$output->writeln(sprintf("<error>The cache dir '%s' is not writable for the system user running this script.</error>", $settings->_cacheDir));
return Command::FAILURE;
}
$reposurl = $input->getOption('url');
if($reposurl)
$extmgr->setRepositoryUrl($reposurl);

View File

@ -55,6 +55,11 @@ class UpdateextensionCommand extends Command
$output->writeln("<comment>Using configuration from '".$settings->_configFilePath."'.</comment>", OutputInterface::VERBOSITY_VERBOSE);
if (!is_writable($settings->_cacheDir)) {
$output->writeln(sprintf("<error>The cache dir '%s' is not writable for the system user running this script.</error>", $settings->_cacheDir));
return Command::FAILURE;
}
$reposurl = $input->getOption('url');
if($reposurl)
$extmgr->setRepositoryUrl($reposurl);