RamblingCookieMonster / BuildHelpers

Helper functions for PowerShell CI/CD scenarios
MIT License
215 stars 47 forks source link

Update-MetaData adds empty line on each call. #83

Open avezinaATastus opened 5 years ago

avezinaATastus commented 5 years ago

Hi,

I use PoweShellBuild and Invoke-Build. When I invoke the task StageFiles, it calls Update-MetaData and I end up with one empty line added each time I call this task.

I did found Issue #27 , I will look at your commits around this time if it can help me solve the problem.

Thank you.

avezinaATastus commented 5 years ago

I can confirm that your fix for #27 , commit id 252c481946eec2ed1ec5b3a7a47feaf98046d402 does work.

I now realise that this commit was for update-metadata. But why are those line not there anymore?

Commit https://github.com/RamblingCookieMonster/BuildHelpers/commit/e0f0dfb911439f96f91e355767fb60baea9820ad#diff-ec5854935c97ef2f48a2a0e03bf89c29L581 remove the StremWriter to use a Set-Content with -NoNewLine param. doesn't seems to work.

For now, I will use this task to remove it :

Task AfterStageFiles -After StageFiles {
    # Removes the empty line
    $manifestContent = Get-Content $env:BHPSModuleManifest | Select-Object -SkipLast 1
    $manifestContent | Out-File $env:BHPSModuleManifest -Encoding utf8
}
RamblingCookieMonster commented 5 years ago

Ahh good catch!

I'll look at updating the embedded module to the latest, and poking around to see if the code in that spot is still not working

Cheers!

lipkau commented 5 years ago

Since July it is possible to use newer versions of Configuration if they are available with Get-Module Configuration -List.

https://github.com/RamblingCookieMonster/BuildHelpers/pull/66