cli/setup: Issue an error if chmod fails when setting up the configuration directory

This commit is contained in:
Eric Lippmann 2014-12-30 15:51:00 +01:00
parent 9c40372b61
commit 9de1b20d3c
1 changed files with 5 additions and 2 deletions

View File

@ -60,13 +60,16 @@ class ConfigCommand extends Command
));
}
$mode = octdec($mode);
if (false === mkdir($configDir)) {
$this->fail(sprintf($this->translate('Unable to create path: %s'), $configDir));
return false;
}
chmod($configDir, $mode);
if (! chmod($configDir, octdec($mode))) {
$this->fail($this->translate(
'Unable to change the mode of the configuration directory'
));
}
if (chgrp($configDir, $group) === false) {
$this->fail(sprintf($this->translate('Unable to change the group of "%s" to "%s".'), $configDir, $group));