From 411d3850a24431abbdf57dbdd63be6341a47cc5c Mon Sep 17 00:00:00 2001 From: kaitranntt Date: Sun, 2 Nov 2025 02:25:19 -0500 Subject: [PATCH] fix(windows): handle null Path when running install.ps1 via irm | iex When running via 'irm ccs.kaitran.ca/install.ps1 | iex', the script executes in-memory without a file path, causing $MyInvocation.MyCommand.Path to be null. This fix checks for null before calling Split-Path to avoid the error: 'Cannot bind argument to parameter Path because it is null' Resolves standalone installation method detection for piped execution. --- install.ps1 | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/install.ps1 b/install.ps1 index 43859091..22a62669 100644 --- a/install.ps1 +++ b/install.ps1 @@ -13,8 +13,18 @@ $ClaudeDir = "$env:USERPROFILE\.claude" $GlmModel = "glm-4.6" # Detect if running from git repository or standalone -$ScriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path -$InstallMethod = if (Test-Path "$ScriptDir\ccs.ps1") { "git" } else { "standalone" } +$ScriptDir = if ($MyInvocation.MyCommand.Path) { + Split-Path -Parent $MyInvocation.MyCommand.Path +} else { + # Running via irm | iex (in-memory, no file path) + $null +} + +$InstallMethod = if ($ScriptDir -and (Test-Path "$ScriptDir\ccs.ps1")) { + "git" +} else { + "standalone" +} # Helper Functions