allow both '/' and '' in folder creation

This commit is contained in:
Nguyen Duc Toan 2024-02-28 20:07:26 +07:00
parent ad0b0e0ae6
commit de02eb93ea

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();