mirror of
https://github.com/RGBCube/embd-rs
synced 2025-07-25 20:47:45 +00:00
Fix relativity finally
This commit is contained in:
parent
41e02a9b3b
commit
9c39ac4a61
3 changed files with 11 additions and 10 deletions
|
@ -70,16 +70,22 @@ pub fn __include_dir(caller: &str, path: &str) -> Dir {
|
|||
}
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! dir {
|
||||
($path:literal) => {{
|
||||
macro_rules! __dir {
|
||||
($caller:literal, $path:literal) => {{
|
||||
#[cfg(debug_assertions)]
|
||||
{
|
||||
::embed::__include_dir(file!(), $path)
|
||||
::embed::__include_dir($caller, $path)
|
||||
}
|
||||
#[cfg(not(debug_assertions))]
|
||||
{
|
||||
::embed_macros::__include_dir!(file!(), $path) // FIXME
|
||||
// ::embed_macros::__include_dir!("embed/src/lib.rs", $path)
|
||||
::embed_macros::__include_dir!($caller, $path)
|
||||
}
|
||||
}};
|
||||
}
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! dir {
|
||||
($path:literal) => {
|
||||
::embed::__dir!(file!(), $path)
|
||||
};
|
||||
}
|
||||
|
|
|
@ -3,7 +3,3 @@ pub use dir::*;
|
|||
|
||||
mod file;
|
||||
pub use file::*;
|
||||
|
||||
// fn expand() {
|
||||
// dir!(".")
|
||||
// }
|
||||
|
|
|
@ -110,7 +110,6 @@ fn read_dir(base: &PathBuf, path: &PathBuf) -> Vec<TokenStream> {
|
|||
entries.push(quote! {
|
||||
::embed::DirEntry(::embed::File {
|
||||
content: include_bytes!(#path_str),
|
||||
// content: include_bytes(#path_str),
|
||||
path: ::std::path::PathBuf::from(#path_str),
|
||||
})
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue