spacehub

surshar / claude-code

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.

Built by Anthropic · github.com/anthropics

Merge pull request #5842 from suwakei/fix/ps1Browse files
Improving the robustness of prerequisite checks
ant-kurt authored on Aug 27, 2025 · GitHub committed on Aug 27, 2025 parents 8beb9b0 + 10a1f7d · commit 55988caadff8
1 changed file+8 -4compared with 8beb9b0
MScript/run_devcontainer_claude_code.ps1
@@ -40,14 +40,18 @@
4040 # --- Prerequisite Check ---
4141 Write-Host "Checking for required commands..."
4242 try {
43- Get-Command $Backend -ErrorAction Stop | Out-Null
43+ if (-not (Get-Command $Backend -ErrorAction SilentlyContinue)) {
44+ throw "Required command '$($Backend)' not found."
45+ }
4446 Write-Host "- $($Backend) command found."
45- Get-Command devcontainer -ErrorAction Stop | Out-Null
47+ if (-not (Get-Command devcontainer -ErrorAction SilentlyContinue)) {
48+ throw "Required command 'devcontainer' not found."
49+ }
4650 Write-Host "- devcontainer command found."
4751 }
4852 catch {
49- Write-Error "A required command is not installed or not in your PATH."
50- Write-Error "Please ensure '$($_.Exception.Message.Split(':')[0])' and 'devcontainer' are installed and accessible."
53+ Write-Error "A required command is not installed or not in your PATH. $($_.Exception.Message)"
54+ Write-Error "Please ensure both '$Backend' and 'devcontainer' are installed and accessible in your system's PATH."
5155 exit 1
5256 }
5357