Closed jasonl99 closed 7 years ago
Urg. Please tag me with the "original poster is an idiot" marker. I didn't even realize that this already took into account where it was installed.
I have a class under src/storage/public_storage.cr
so the correct path to get to the public directory is this: BakedFileSystem.load("../../public")
if anyone else runs into something similar.
I'm using baked_file_system to serve files from a shard if they are not present on the app. So I use
BakedFileStorage.load("../lib/foo/public")
for example to load from a shard namedfoo
.The shards.yml spec allows you to specify sources of
github
,git
, andpath
. shards install/update seems to create a symlink when you usepath:
in the yml file, which is great, because it's constantly the current version if you are testing the shard within an app (you don't have to constantly be runningshards update
However, for some reason, BakeFileStorage isn't reading symlinked files. So if my shard.yml file looks like this:
and run the following code:
But if I delete the symlinked lib/foo directory and actually copy over the /home/crystal/foo project into the lib folder, it works as expected and my files are there.