mirror of
https://github.com/tiennm99/ccs.git
synced 2026-10-12 14:14:47 +00:00
fix(windows): add null check for ScriptDir in uninstall script detection
Line 166 was calling Test-Path with null ScriptDir when running via irm | iex, causing 'Cannot bind argument to parameter Path because it is null' error. Added null check: if ($ScriptDir -and (Test-Path ...)) to safely skip to standalone mode when ScriptDir is null.
This commit is contained in:
1 parent
411d3850a2
commit
6bc6db6f31
1 file changed
+1
-1
+1
-1
@@ -163,7 +163,7 @@ if ($InstallMethod -eq "standalone") {
|
||||
}
|
||||
|
||||
# Install uninstall script
|
||||
if (Test-Path "$ScriptDir\uninstall.ps1") {
|
||||
if ($ScriptDir -and (Test-Path "$ScriptDir\uninstall.ps1")) {
|
||||
# Only copy if source and destination are different
|
||||
if ($ScriptDir -ne $CcsDir) {
|
||||
Copy-Item "$ScriptDir\uninstall.ps1" "$CcsDir\uninstall.ps1" -Force
|
||||
|
||||
Reference in new issue
Block a user