This commit is contained in:
2021-05-12 12:05:01 +02:00
parent ec6c71798f
commit ffb5dbdaae
104 changed files with 6733 additions and 3490 deletions
@@ -73,11 +73,11 @@ class InstallCommand extends GravCommand
$io = $this->getIO();
$dependencies_file = '.dependencies';
$this->destination = $input->getArgument('destination') ?: GRAV_ROOT;
$this->destination = $input->getArgument('destination') ?: GRAV_WEBROOT;
// fix trailing slash
$this->destination = rtrim($this->destination, DS) . DS;
$this->user_path = $this->destination . USER_PATH;
$this->user_path = $this->destination . GRAV_USER_PATH . DS;
if ($local_config_file = $this->loadLocalConfig()) {
$io->writeln('Read local config from <cyan>' . $local_config_file . '</cyan>');
}
@@ -600,7 +600,13 @@ class InstallCommand extends GpmCommand
try {
$output = Response::get($package->zipball_url . $query, [], [$this, 'progress']);
} catch (Exception $e) {
$error = str_replace("\n", "\n | '- ", $e->getMessage());
if (!empty($package->premium) && $e->getCode() === 401) {
$message = '<yellow>Unauthorized Premium License Key</yellow>';
} else {
$message = $e->getMessage();
}
$error = str_replace("\n", "\n | '- ", $message);
$io->write("\x0D");
// extra white spaces to clear out the buffer properly
$io->writeln(' |- Downloading package... <red>error</red> ');
@@ -112,7 +112,7 @@ class UninstallCommand extends GpmCommand
unset($this->data['not_found'], $this->data['total']);
// Plugins need to be initialized in order to make clear-cache to work.
// Plugins need to be initialized in order to make clearcache to work.
try {
$this->initializePlugins();
} catch (Throwable $e) {