XAMPPRocky / fluent-templates

Easily add Fluent to your Rust project.
Apache License 2.0
136 stars 28 forks source link

Adding CARGO_MANIFEST_DIR to make paths consistent #6

Closed ecton closed 4 years ago

ecton commented 4 years ago

Fixes #3

Problem: When a crate is in a workspace, the current directory may not always be the root of the workspace depending on what cargo task is running. As the #3 showed, cargo test --doc appears to run with the current directory set to the crate itself, whereas when running the rest of the cargo suite, the current working directory is set to the workspace root.

Solution: Cargo provides CARGO_MANIFEST_DIR to locate the directory that contains Cargo.toml for the currently compiling crate. This patch uses it to resolve core_locales and locales_directory.

XAMPPRocky commented 4 years ago

Thank you for your PR, and congrats on your first contribution! 🎉

XAMPPRocky commented 4 years ago

This has pulished in 0.5.6