Skip to content

Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.

TypeScript

Improving the robustness of prerequisite checks

keitosuwahara10a1f7dab940
diff --git a/Script/run_devcontainer_claude_code.ps1 b/Script/run_devcontainer_claude_code.ps1
index 5b99d7d8..468750ed 100644
--- a/Script/run_devcontainer_claude_code.ps1
+++ b/Script/run_devcontainer_claude_code.ps1
@@ -40,14 +40,18 @@ Write-Host "Using backend: $($Backend)"
# --- Prerequisite Check ---
Write-Host "Checking for required commands..."
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."
- 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."
}
catch {
- Write-Error "A required command is not installed or not in your PATH."
- Write-Error "Please ensure '$($_.Exception.Message.Split(':')[0])' and 'devcontainer' are installed and accessible."
+ Write-Error "A required command is not installed or not in your PATH. $($_.Exception.Message)"
+ Write-Error "Please ensure both '$Backend' and 'devcontainer' are installed and accessible in your system's PATH."
exit 1
}