schovi / baked_file_system

Virtual File System for Crystal language. Embedding your assets into final binary.
MIT License
177 stars 18 forks source link

Raise error for invalid paths #11

Closed straight-shoota closed 6 years ago

straight-shoota commented 6 years ago

Closes #4

This requires crystal-lang/crystal#4614 to properly show the error messages from macro run. But the next Crystal release 0.24 should arrive shortly.

Output looks like this:

Error in line 1: while requiring "./failing-test.cr"

in failing-test.cr:10: expanding macro

      BakedFileSystem.load("./invalid_path", __DIR__)
                      ^~~~

in src/baked_file_system.cr:102: Error executing run (exit code: 1): ./loader "./invalid_path" "/test/crystal/baked_file_system"

stderr:

    directory /test/crystal/baked_file_system/invalid_path does not exist (Exception)
      from ???
      from ???
      from __crystal_main
      from main
      from __libc_start_main
      from ???
      from ???

    source = {{ run("./loader", path, source).stringify }}
straight-shoota commented 6 years ago

ping @schovi

schovi commented 6 years ago

@straight-shoota Didn't get a next notifications. Sorry for delay :)