Skip to content

Commit

Permalink
Merge pull request #91 from hydephp/release/v0.7.17
Browse files Browse the repository at this point in the history
HydeCLI v0.7.17
  • Loading branch information
caendesilva authored Apr 19, 2024
2 parents a0de20b + 8d0caba commit dafe203
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 10 deletions.
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.16';
final public const APP_VERSION = '0.7.17';

public function getCachedPackagesPath(): string
{
Expand Down
13 changes: 4 additions & 9 deletions app/Commands/SelfUpdateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
use function json_decode;
use function is_writable;
use function curl_setopt;
use function str_replace;
use function array_combine;
use function str_ends_with;
use function clearstatcache;
Expand Down Expand Up @@ -128,7 +129,7 @@ public function handle(): int

$this->info('The application has been updated successfully.');

// Verify the application version
// Verify the application version (// Fixme: This shows the old version when using Composer to update)
passthru('hyde --version --ansi');

// Now we can exit the application, we do this manually to avoid issues when Laravel tries to clean up the application
Expand Down Expand Up @@ -431,19 +432,13 @@ protected function runComposerInElevatedPrompt(): void
$outputStream = realpath($outputStream);

// Set up a batch script so we can redirect the output to our stream file
$batch = <<<CMD
call composer global require hyde/cli --no-interaction 2> $outputStream
echo --END-- >> $outputStream
CMD;
$batch = str_replace('{{ outputStream }}', $outputStream, file_get_contents(__DIR__.'/../bin/composer-update-proxy.bat'));

$updateScript = "$path.bat";
file_put_contents($updateScript, $batch);
$updateScript = realpath($updateScript);

$vbs = <<<VBS
Set UAC = CreateObject("Shell.Application")
UAC.ShellExecute "cmd.exe", "/c $updateScript", "", "runas", 0
VBS;
$vbs = str_replace('{{ updateScript }}', $updateScript, file_get_contents(__DIR__.'/../bin/composer-update-proxy.vbs'));

$vbsScript = "$path.vbs";
file_put_contents($vbsScript, $vbs);
Expand Down
2 changes: 2 additions & 0 deletions app/bin/composer-update-proxy.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
call composer global require hyde/cli --no-interaction 2> {{ outputStream }}
echo --END-- >> {{ outputStream }}
2 changes: 2 additions & 0 deletions app/bin/request-composer-user-access-control.vbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Set UAC = CreateObject("Shell.Application")
UAC.ShellExecute "cmd.exe", "/c {{ updateScript }}", "", "runas", 0
Binary file modified builds/hyde
Binary file not shown.

0 comments on commit dafe203

Please sign in to comment.