Skip to content

Commit f09cbc2

Browse files
committed
accounting for forward slashes
1 parent d653d72 commit f09cbc2

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

internal/functions/Get-DbopsFile.ps1

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,10 @@
3333
$srcPath = $pkgPath = $childItem.Name
3434
}
3535
# replace some symbols here and there
36-
$srcPath = $srcPath -replace '^\.\\', ''
37-
$pkgPath = $pkgPath -replace '^\.\\|:', ''
36+
$slash = [IO.Path]::DirectorySeparatorChar
37+
$slashRegex = [Regex]::Escape(".$slash")
38+
$srcPath = $srcPath -replace "^$slashRegex", ''
39+
$pkgPath = $pkgPath -replace "^$slashRegex|:", ''
3840
[DBOpsFile]::new($childItem, $srcPath, $pkgPath, $true)
3941
}
4042
}

0 commit comments

Comments
 (0)