mirror of
https://github.com/anthropics/claude-code.git
synced 2025-10-19 03:17:50 +03:00
Improving the robustness of prerequisite checks
This commit is contained in:
@@ -40,14 +40,18 @@ Write-Host "Using backend: $($Backend)"
|
|||||||
# --- Prerequisite Check ---
|
# --- Prerequisite Check ---
|
||||||
Write-Host "Checking for required commands..."
|
Write-Host "Checking for required commands..."
|
||||||
try {
|
try {
|
||||||
Get-Command $Backend -ErrorAction Stop | Out-Null
|
if (-not (Get-Command $Backend -ErrorAction SilentlyContinue)) {
|
||||||
|
throw "Required command '$($Backend)' not found."
|
||||||
|
}
|
||||||
Write-Host "- $($Backend) command found."
|
Write-Host "- $($Backend) command found."
|
||||||
Get-Command devcontainer -ErrorAction Stop | Out-Null
|
if (-not (Get-Command devcontainer -ErrorAction SilentlyContinue)) {
|
||||||
|
throw "Required command 'devcontainer' not found."
|
||||||
|
}
|
||||||
Write-Host "- devcontainer command found."
|
Write-Host "- devcontainer command found."
|
||||||
}
|
}
|
||||||
catch {
|
catch {
|
||||||
Write-Error "A required command is not installed or not in your PATH."
|
Write-Error "A required command is not installed or not in your PATH. $($_.Exception.Message)"
|
||||||
Write-Error "Please ensure '$($_.Exception.Message.Split(':')[0])' and 'devcontainer' are installed and accessible."
|
Write-Error "Please ensure both '$Backend' and 'devcontainer' are installed and accessible in your system's PATH."
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user