diff --git a/CHANGELOG.md b/CHANGELOG.md index 69cd069..f940e65 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,8 @@ This update introduces minor bug fixes. - Fixed division by zero in ConsoleProgressBar - Fixed issue where progress bar is displayed in VERBOSE mode - Set default process timeouts to null + - Fixed issue where a newline is sometimes added to the end of a download output due to how short the download process + was, mitigated the issue by enforcing a "done" update at the end of the download process ## [2.0.3] - 2023-10-17 diff --git a/src/ncc/Managers/PackageManager.php b/src/ncc/Managers/PackageManager.php index 7ea7e5c..c4e3982 100644 --- a/src/ncc/Managers/PackageManager.php +++ b/src/ncc/Managers/PackageManager.php @@ -906,6 +906,11 @@ return; } + if($downloaded > $download_size) + { + $download_size = $downloaded; + } + if(Resolver::checkLogLevel(LogLevel::VERBOSE, Main::getLogLevel())) { $percentage = round(($downloaded / $download_size) * 100, 2); @@ -926,10 +931,14 @@ } }); - unset($progress_bar); curl_exec($curl); fclose($file_handle); + $progress_bar->setMaxValue(100); + $progress_bar->setValue(100); + $progress_bar->setMiscText('done', true); + unset($progress_bar); + if(curl_errno($curl)) { ShutdownHandler::declareTemporaryPath($file_path); diff --git a/src/ncc/Objects/PackageLock/PackageEntry.php b/src/ncc/Objects/PackageLock/PackageEntry.php index 5206743..c07dc1b 100644 --- a/src/ncc/Objects/PackageLock/PackageEntry.php +++ b/src/ncc/Objects/PackageLock/PackageEntry.php @@ -24,6 +24,7 @@ namespace ncc\Objects\PackageLock; + use Exception; use InvalidArgumentException; use ncc\Classes\PackageReader; use ncc\Enums\FileDescriptor; @@ -41,6 +42,7 @@ use ncc\Objects\ProjectConfiguration\UpdateSource; use ncc\ThirdParty\composer\Semver\Semver; use ncc\ThirdParty\jelix\Version\VersionComparator; + use ncc\Utilities\Console; use ncc\Utilities\Functions; use ncc\Utilities\IO; @@ -189,8 +191,9 @@ { $version = $this->getLatestVersion(); } - catch(InvalidArgumentException $e) + catch(Exception $e) { + Console::outWarning(sprintf('Unable to find latest version for package %s, called on versionExists() in PackageEntry: %s', $this->name, $e->getMessage())); return false; } }