schovi / baked_file_system

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

`BakedFileSystem empty: no files` thrown but files are there (Windows) #49

Closed sol-vin closed 3 months ago

sol-vin commented 3 months ago
module Crixel::Assets::BakedFS
  extend BakedFileSystem

  bake_folder "rsrc", dir: "./"
end

throws

Unhandled exception: BakedFileSystem empty: no files in C:\Users\Ian\Documents\GitHub\crixel\rsrc (Exception)
  from src\crixel.cr:21 in '__crystal_main'
  from C:\Users\Ian\scoop\apps\crystal\current\src\crystal\main.cr:129 in 'main_user_code'
  from C:\Users\Ian\scoop\apps\crystal\current\src\crystal\main.cr:115 in 'main'
  from C:\Users\Ian\scoop\apps\crystal\current\src\crystal\main.cr:141 in 'main'
  from C:\Users\Ian\scoop\apps\crystal\current\src\crystal\system\win32\wmain.cr:37 in 'wmain'
  from D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288 in '__scrt_common_main_seh'
  from C:\WINDOWS\System32\KERNEL32.DLL +95044 in 'BaseThreadInitThunk'
  from C:\WINDOWS\SYSTEM32\ntdll.dll +337585 in 'RtlUserThreadStart'

But the files are there :( This also happens regardless of if I use an absolute or relative path or if I change dir or not.

https://github.com/schovi/baked_file_system/assets/1298501/0ea34ef2-7084-466f-8989-babbf788143f

I also tapped into the loader/loader.cr file to print debug stuff to another file. It produced nothing.

loader/loader.cr line 23

      test_file = File.open("./rsrc/test", "w+")
      files = Dir.glob(File.join(root_path, "**", "*"))
                 # Reject hidden entities and directories
                 .map { |path| test_file.puts path; path }.reject { |path| File.directory?(path) || !(path =~ /(\/\..+)/).nil? }
      test_file.close
sol-vin commented 3 months ago

NVM it wasnt using latest version my bad

sol-vin commented 3 months ago

@schovi Please consider changing the dependency line in the README to

  baked_file_system:
    github: schovi/baked_file_system
    branch: master