majkinetor / au

Chocolatey Automatic Package Updater Module
GNU General Public License v2.0
227 stars 71 forks source link

Make directory separators platform agnostic #237

Closed TheCakeIsNaOH closed 3 years ago

TheCakeIsNaOH commented 3 years ago

This does not get everything, specifically, I did not touch the tests, or the automatic checksumming section.

For the automatic checksumming, I am kind of in favor of putting a check for non-windows, telling people to use Get-RemoteChecksum or embed, then throwing.

Also, $ENV:Temp does not exist on Linux, so I switched that to [System.IO.Path]::GetTempPath().

Part of #234

majkinetor commented 3 years ago

Isn't slash type irrelevant - '/' works on Windows and \ should work in pwsh on linux ? I just tested it and works fine.

I did not touch the tests

Tests should work too cross-platform if we go with this; those that are Windwos specific, if any, could be tagged.

For the automatic checksumming, I am kind of in favor of putting a check for non-windows, telling people to use Get-RemoteChecksum or embed, then throwing.

I was thinking in deprecating automatic checksum but I guess people use that a lot. So yeah, that, is a must. Also I am not sure about choco dependency in general (but lets talk about that on #234.

TheCakeIsNaOH commented 3 years ago

Isn't slash type irrelevant - '/' works on Windows and \ should work in pwsh on linux ? I just tested it and works fine.

I had issues with NuspecPath and get-remotefiles.

Tests should work too cross-platform if we go with this; those that are Windows specific, if any, could be tagged.

I haven't been able to get them to work (yet), but that is good to know.