allow both '/' and '' in folder creation

This commit is contained in:
Nguyen Duc Toan 2024-02-28 20:16:14 +07:00
parent b6fb02fda3
commit af7c325b22

View file

@ -32,7 +32,7 @@ impl Manager {
}
}
if name.ends_with(MAIN_SEPARATOR) {
if name.ends_with('/') || name.ends_with('\\') {
fs::create_dir_all(&path).await?;
} else {
fs::create_dir_all(&path.parent().unwrap()).await.ok();