Sammyjo20 / lasso

🐎 Lasso is a Laravel package created to make your deployments blazing fast.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cross-platform problem with path separator

io238 opened this issue · comments

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.

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.

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

See also:
symfony/symfony#15472
https://www.php.net/manual/en/ziparchive.addfile.php

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

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!

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

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