From 6238508a2181d70d437b599bbd19b17baa73c882 Mon Sep 17 00:00:00 2001 From: Darii Nurgaleev Date: Tue, 13 Oct 2020 20:02:18 +0700 Subject: [PATCH] added relative path instead of fullpath --- images.CI/shebang-linter.ps1 | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/images.CI/shebang-linter.ps1 b/images.CI/shebang-linter.ps1 index bba5ed02e..3397f99d5 100644 --- a/images.CI/shebang-linter.ps1 +++ b/images.CI/shebang-linter.ps1 @@ -9,13 +9,14 @@ function Validate-Scripts { ) $ScriptWithoutShebangLine = @() Get-ChildItem $path -Recurse -File -Filter "*.sh" | ForEach-Object { - $shebangLine = Get-Content -Path $($_.FullName) | Select-Object -First 1 + $RelativePath = Join-Path $Path $($_.Name) + $shebangLine = Get-Content -Path $RelativePath | Select-Object -First 1 if ($shebangLine -eq $ExpectedShebang) { - Write-Host "Pattern '$ExpectedShebang' found in '$($_.FullName)'" + Write-Host "Pattern '$ExpectedShebang' found in '$RelativePath'" } else { - Write-Host "Pattern '$ExpectedShebang' not found in '$($_.FullName)'" - $ScriptWithoutShebangLine += $($_.FullName) + Write-Host "Pattern '$ExpectedShebang' not found in '$RelativePath'" + $ScriptWithoutShebangLine += $RelativePath } } return $ScriptWithoutShebangLine