diff --git a/app/Application.php b/app/Application.php index de3d3a18..72bbde4a 100644 --- a/app/Application.php +++ b/app/Application.php @@ -6,7 +6,7 @@ class Application extends \Hyde\Foundation\Application { - final public const APP_VERSION = '0.7.2'; + final public const APP_VERSION = '0.7.3'; public function getCachedPackagesPath(): string { diff --git a/app/Commands/SelfUpdateCommand.php b/app/Commands/SelfUpdateCommand.php index b3bc0639..2b51e6fc 100644 --- a/app/Commands/SelfUpdateCommand.php +++ b/app/Commands/SelfUpdateCommand.php @@ -274,7 +274,18 @@ protected function replaceApplication(string $downloadedFile): void $this->debug("Moving file $downloadedFile to $applicationPath"); // Replace the current application with the downloaded one - rename($downloadedFile, $applicationPath); + try { + // This might give Permission denied if we can't write to the bin path (might need sudo) + rename($downloadedFile, $applicationPath); + } catch (Throwable $exception) { + // Check if it is a permission issue + if (Str::containsAll($exception->getMessage(), ['rename', 'Permission denied'])) { + throw new RuntimeException('The application path is not writable. Please rerun the command with elevated privileges (e.g. using sudo).', 126, $exception); + } + + // Unknown error, rethrow the exception + throw $exception; + } } protected function updateViaComposer(): void diff --git a/builds/hyde b/builds/hyde index 42222615..fcf5028d 100755 Binary files a/builds/hyde and b/builds/hyde differ