Better GPM detection of unauthorized installations

This commit is contained in:
Djamil Legato
2021-04-08 21:21:27 -07:00
parent 1e2d86f054
commit e0fc832621
2 changed files with 13 additions and 1 deletions

View File

@@ -1,3 +1,9 @@
# v1.7.11
## mm/dd/2021
1. [](#improved)
* Better GPM detection of unauthorized installations
# v1.7.10
## 04/06/2021

View File

@@ -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> ');