Sammyjo20 / lasso

🐎 Lasso is a Laravel package created to make your deployments blazing fast.
MIT License
341 stars 16 forks source link

Cross-platform problem with path separator #36

Closed io238 closed 4 years ago

io238 commented 4 years ago

When publishing assets on Windows and pulling them into Linux, the asset directory structure is not properly preserved. Instead after unzipping, assets include the path with backward slashes in the filename (e.g. assets\css\bootstrap.min.css).

I assume that happens because directory separators are hard-coded as forward slash (/), but should use the PHP global constant DIRECTORY_SEPARATOR to avoid cross-platform issues with path names.

Sammyjo20 commented 4 years ago

Ah, yeah that would be a really good change, thanks for the heads up @io238 - I'll try and get this updated for you as soon as possible.

io238 commented 4 years ago

I went a bit into the details of this. Seems to be an inconsistency how the Symfony Finder class returns path names.

See also: https://github.com/symfony/symfony/issues/15472 https://www.php.net/manual/en/ziparchive.addfile.php

I've added a pull request with a fix for this.

Sammyjo20 commented 4 years ago

Thanks so much @io238 - sorry for the slow reply to this PR, been very busy. I'm going to be looking into this tomorrow for you, and thank you for the PR!

alexjustesen commented 4 years ago

@Sammyjo20 from our Twitter chat, looks like @io238 did the work already and has a PR. Tested and works like a charm on Windows.

Sammyjo20 commented 4 years ago

This has now been merged, I'll tag a release for it now @alexjustesen 🤘