Skip to content

Commit bec074b

Browse files
committed
fixed windows script for null drive issue
1 parent 286311a commit bec074b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

update-all-repos.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ $commitMsgSrc = Join-Path $TEMPLATE_HOOKS "commit-msg"
3737

3838
# No path given = scan all local fixed drives (C:\, D:\, E:\, etc.)
3939
if ($TargetPaths.Count -eq 0) {
40-
$TargetPaths = [System.IO.DriveInfo]::GetDrives() | Where-Object { $_.DriveType -eq 'Fixed' -and $_.IsReady } | ForEach-Object { $_.Root.TrimEnd('\') + '\' }
40+
$TargetPaths = [System.IO.DriveInfo]::GetDrives() | Where-Object { $_.DriveType -eq 'Fixed' -and $_.IsReady -and $null -ne $_.Root } | ForEach-Object { $_.Root.TrimEnd('\') + '\' }
4141
if ($TargetPaths.Count -eq 0) {
4242
Write-Fail "No local drives found."
4343
exit 1

0 commit comments

Comments
 (0)