refactor(tvix/eval): use EvalIO::path_exists for the builtin
Change-Id: I49822ce30137777865e7370ee86666636e277b35 Reviewed-on: https://cl.tvl.fyi/c/depot/+/7573 Tested-by: BuildkiteCI Reviewed-by: grfn <grfn@gws.fyi>
This commit is contained in:
parent
ec3e38c2d6
commit
51deadd983
2 changed files with 18 additions and 2 deletions
|
|
@ -28,7 +28,8 @@ mod impure_builtins {
|
|||
|
||||
#[builtin("pathExists")]
|
||||
fn builtin_path_exists(vm: &mut VM, s: Value) -> Result<Value, ErrorKind> {
|
||||
Ok(coerce_value_to_path(&s, vm)?.exists().into())
|
||||
let path = coerce_value_to_path(&s, vm)?;
|
||||
vm.io().path_exists(path).map(Value::Bool)
|
||||
}
|
||||
|
||||
#[builtin("readDir")]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue