diff options
author | Nayeem Rahman <muhammed.9939@gmail.com> | 2020-02-25 14:23:23 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-25 09:23:23 -0500 |
commit | 14e7e1e3af43b2322a26fcc542428c8f1af4460d (patch) | |
tree | 37b61598d27754b4f145a211f3f0c0ed400876bb /cli/ops | |
parent | 91b606aaae23bcb790b55adc5fe70a182a37d564 (diff) |
fix: Resolve makeTemp* paths from CWD (#4104)
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); |