Skip to content

Crash on --include/--include-path (Windows) #37

@iki

Description

@iki

Steps to reproduce:

# Macros - not needed, crashes with import and --include/--include-path independently on file existence
$ echo '{% macro format_num(val) -%}{{ val }}{%- endmacro -%}' > macros.html 

$ echo 'test: 1' > context.yaml

$ echo '{% import "macros.html" as macros %}' > test.md
$ echo '{{ macros::format_num(val=test) }}' >> test.md # Not needed, crashes with import only

# Crash with --include
$ tera --template test.md --include context.yaml
The application panicked (crashed).
Message:  called `Result::unwrap()` on an `Err` value: StripPrefixError(())
Location: C:\Users\runneradmin\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tera-1.20.0\src\tera.rs:209

# Crash with --include-path
$ tera --template test.md --include-path . context.yaml
The application panicked (crashed).
Message:  called `Result::unwrap()` on an `Err` value: StripPrefixError(())
Location: C:\Users\runneradmin\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tera-1.20.0\src\tera.rs:209

# Error without --include/--include-path
$ tera --template test.md context.yaml
Error:
   0: failed to render
   1: Template `__tera_one_off` loads macros from `Vzory/macros.html` which isn't present in Tera

Location:
   src\main.rs:81

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions