add cool console output

This commit is contained in:
crazywhalecc 2023-12-22 16:54:28 +08:00
parent 0810071ed4
commit 84059abb9a
2 changed files with 7 additions and 2 deletions

View File

@ -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

View File

@ -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
}
}