Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Glug binary doesn't work with include_file #12

Open
gravitystorm opened this issue Jan 6, 2023 · 0 comments
Open

Glug binary doesn't work with include_file #12

gravitystorm opened this issue Jan 6, 2023 · 0 comments

Comments

@gravitystorm
Copy link

If I try to use the glug command with a complex stylesheet that has multiple files, it fails to resolve the paths given by "include_file" statements. An example error message for a style.glug with include_file "landcover.glug" is:

 No such file or directory @ rb_sysopen - /landcover.glug (Errno::ENOENT)

I think this is because the glug command doesn't pass a base_dir option to Stylesheet.new, and File.join('', 'foo') == "/foo"

Since base_dir is only used when handling "include_file", perhaps it's possible to remove this option entirely, and treat all "include_file" as relative paths to the file that has the statement? This would also mean for example that you could do:

  • style.glug - include_file "shared/landcover.glug"
  • shared/landcover.glug - include_file "colours.glug" <- this would load shared/colours.glug

But if that's not possible, then the glug binary should at least pass the directory of the target file as the base_dir.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant