diff options
Diffstat (limited to 'cli/ops')
-rw-r--r-- | cli/ops/fs.rs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/cli/ops/fs.rs b/cli/ops/fs.rs index 13c2418cb..4d7bd9d15 100644 --- a/cli/ops/fs.rs +++ b/cli/ops/fs.rs @@ -9,7 +9,7 @@ use deno_core::*; use remove_dir_all::remove_dir_all; use std::convert::From; use std::fs; -use std::path::{Path, PathBuf}; +use std::path::Path; use std::time::UNIX_EPOCH; #[cfg(unix)] @@ -534,7 +534,9 @@ fn op_make_temp_dir( ) -> Result<JsonOp, OpError> { let args: MakeTempArgs = serde_json::from_value(args)?; - let dir = args.dir.map(PathBuf::from); + let dir = args + .dir + .map(|s| deno_fs::resolve_from_cwd(Path::new(&s)).unwrap()); let prefix = args.prefix.map(String::from); let suffix = args.suffix.map(String::from); @@ -566,7 +568,9 @@ fn op_make_temp_file( ) -> Result<JsonOp, OpError> { let args: MakeTempArgs = serde_json::from_value(args)?; - let dir = args.dir.map(PathBuf::from); + let dir = args + .dir + .map(|s| deno_fs::resolve_from_cwd(Path::new(&s)).unwrap()); let prefix = args.prefix.map(String::from); let suffix = args.suffix.map(String::from); |