nickjj / flask-static-digest

Flask extension to help make your static files production ready by md5 tagging and gzipping them.
MIT License
157 stars 27 forks source link

Add support for Windows #6

Closed extant1 closed 4 years ago

extant1 commented 4 years ago

Add support for Windows

Fix is from @Shimada666 closing out #2, I've made the changes discussed in #4 and attaching video recording showing the issue and the changes in a windows environment.

https://www.youtube.com/watch?v=JeIf87pEfb0

Edit: Sorry if I did this wrong as I didn't see a way to commit to the other pull request.

nickjj commented 4 years ago

Hi,

Thanks a lot for the PR.

You know, after looking at the old PR and the issues at hand, would it be even easier if we didn't use os.path.relpath? What if we just used string interpolation and hard coded the / as a separator. I didn't test this in Linux or Windows, but something like rel_file_path = f"{file}/{output_path}".

Or if that doesn't end up working, what about a string replace on \\ to / like rel_file_path = os.path.relpath(file, output_path).replace("\\", "/")?

extant1 commented 4 years ago

I tried the first option and it won't work without extra code to work on the paths but the latter works perfectly and is the more elegant option between all of them.

extant1 commented 4 years ago

Pay no attention to the commit hiding behind the curtain.

nickjj commented 4 years ago

Hi,

Is there any chance you can destroy this PR, and make a new one with the latest passing code with a single Add support for Windows commit message?