removed relative path

This commit is contained in:
Darii Nurgaleev
2020-10-13 21:02:57 +07:00
parent 6d776ba19b
commit b6357f0e00

View File

@@ -9,14 +9,13 @@ function Validate-Scripts {
) )
$ScriptWithoutShebangLine = @() $ScriptWithoutShebangLine = @()
Get-ChildItem $path -Recurse -File -Filter "*.sh" | ForEach-Object { Get-ChildItem $path -Recurse -File -Filter "*.sh" | ForEach-Object {
$RelativePath = Join-Path $Path $($_.Name) $shebangLine = Get-Content -Path $($_.FullName)| Select-Object -First 1
$shebangLine = Get-Content -Path $RelativePath | Select-Object -First 1
if ($shebangLine -eq $ExpectedShebang) { if ($shebangLine -eq $ExpectedShebang) {
Write-Host "Pattern '$ExpectedShebang' found in '$RelativePath'" Write-Host "Pattern '$ExpectedShebang' found in '$($_.FullName)'"
} }
else { else {
Write-Host "Pattern '$ExpectedShebang' not found in '$RelativePath'" Write-Host "Pattern '$ExpectedShebang' not found in '$($_.FullName)'"
$ScriptWithoutShebangLine += $RelativePath $ScriptWithoutShebangLine += $($_.FullName)
} }
} }
return $ScriptWithoutShebangLine return $ScriptWithoutShebangLine