Skip to content

Commit

Permalink
..
Browse files Browse the repository at this point in the history
  • Loading branch information
sxyazi committed Sep 14, 2024
1 parent be3f2e6 commit ab094c2
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions yazi-plugin/src/fs/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,21 +52,6 @@ pub fn install(lua: &Lua) -> mlua::Result<()> {
}
})?,
),
(
"create",
lua.create_async_function(|lua, (type_, url): (mlua::String, UrlRef)| async move {
let result = match type_.to_str()? {
"file" => fs::File::create(&*url).await.map(|_| ()),
"dir" => fs::create_dir(&*url).await,
_ => Err("Creation type must be 'file', 'dir'".into_lua_err())?,
};

match result {
Ok(_) => (true, Value::Nil).into_lua_multi(lua),
Err(e) => (false, e.raw_os_error()).into_lua_multi(lua),
}
})?,
),
(
"read_dir",
lua.create_async_function(|lua, (dir, options): (UrlRef, Table)| async move {
Expand Down

0 comments on commit ab094c2

Please sign in to comment.