Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HydeCLI v0.7.3 #66

Merged
merged 3 commits into from
Apr 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
13 changes: 12 additions & 1 deletion app/Commands/SelfUpdateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Binary file modified builds/hyde
Binary file not shown.
Loading