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

feat: handle path suffix in windows #20

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

darkskygit
Copy link

@darkskygit darkskygit commented Aug 14, 2024

fix #5

this pr fix the follow case:

const ASSETS: Embeds = embed! {
    base_path: "assets",
    files: ["static/*", "static/js/*", "static/**/*"],
};

pub async fn get_assets() -> Assets {
    let mut builder = Assets::builder();
    builder.add_embedded("test3/", &ASSETS["static/*"]);
    builder.add_embedded("test1/", &ASSETS["static/js/*"]);
    builder.add_embedded("test2/", &ASSETS["static/**/*"]);
    builder.build().await.expect("Failed to initialize assets")
}
  • static/* will match folder
  • in windows, static/js/ will be split to static/js/, but f.path will parse like this: static\js\something.js
  • in windows and static/**/* glob, http_path will get hash key like this: static/js\something.js

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

Successfully merging this pull request may close these issues.

Fix paths on Windows
1 participant