From 84059abb9a17e3a8e7a2af54ae56e2c7d0653179 Mon Sep 17 00:00:00 2001 From: crazywhalecc Date: Fri, 22 Dec 2023 16:54:28 +0800 Subject: [PATCH] add cool console output --- bin/setup-runtime.ps1 | 7 ++++++- bin/spc.ps1 | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/bin/setup-runtime.ps1 b/bin/setup-runtime.ps1 index 2c4d3077..f7f73e82 100644 --- a/bin/setup-runtime.ps1 +++ b/bin/setup-runtime.ps1 @@ -40,4 +40,9 @@ if (-not(Test-Path "runtime\composer.phar")) # create runtime\composer.ps1 Set-Content -Path 'runtime\composer.ps1' -Value 'Start-Process "runtime\php.exe" ("runtime\composer.phar " + $args) -NoNewWindow -Wait' -Encoding UTF8 -Write-Host "Successfully downloaded PHP and Composer !" +Write-Host "Successfully downloaded PHP and Composer !" -ForegroundColor Green +Write-Host "Use static-php-cli: bin/spc" -ForegroundColor Green +Write-Host "Use php: runtime/php" -ForegroundColor Green +Write-Host "Use composer: runtime/composer" -ForegroundColor Green +Write-Host "" +Write-Host "Don't forget installing composer dependencies ('runtime/composer install') before using static-php-cli !" -ForegroundColor Cyan \ No newline at end of file diff --git a/bin/spc.ps1 b/bin/spc.ps1 index 74991b80..7123a880 100644 --- a/bin/spc.ps1 +++ b/bin/spc.ps1 @@ -3,7 +3,7 @@ $PHP_Exec = "runtime\php.exe" if (-not(Test-Path $PHP_Exec)) { $PHP_Exec = Get-Command php.exe -ErrorAction SilentlyContinue | Select-Object -ExpandProperty Definition if (-not $PHP_Exec) { - Write-Host "Error: PHP not found." -ForegroundColor Red + Write-Host "Error: PHP not found, you need to install PHP on your system or use 'bin/setup-runtime'." -ForegroundColor Red exit 1 } }