stencilproject / Stencil

Stencil is a simple and powerful template language for Swift.
https://stencil.fuller.li
BSD 2-Clause "Simplified" License
2.33k stars 221 forks source link

FileSystemLoader's bundle-based initializer misses bundle resources on macOS #279

Open nolanw opened 5 years ago

nolanw commented 5 years ago

Hello! I recently tried getting an iOS project running on Catalyst and one of the issues I came across was that FileSystemLoader couldn't load any template files on macOS (while it works fine on iOS). Looking at the implementation, the reason was clear: while iOS bundles put resources at the bundle root, macOS bundles put them in a Resources subdirectory, and FileSystemLoader.init(bundle:) doesn't use Bundle.resourcePath or Bundle.resourceURL so it was looking in the wrong place.

I'm happy to pass in resourceURL myself (or write my own lil BundleResourceLoader) but I figured I'd ask: would it be a useful contribution to adjust FileSystemLoader somehow to consider resourceURL, and/or to add a BundleResourceLoader? I can open a PR if that'd be useful. If not, I'm happy to go about my day :)

schwa commented 4 years ago

Question asked in July…

lethanix commented 3 years ago

Question asked in July x2...