diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2020-02-26 22:11:52 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-26 22:11:52 +0100 |
commit | daf7617f42e2e7520344ec98db3d60016b85fd73 (patch) | |
tree | 7469656b3640dd9130855316779b823dbe9bfa4b /cli/ops/runtime.rs | |
parent | fb1075da6e33a65daaa3e9c2ecf1d7a9a5021f58 (diff) |
rewrite normalize_path (#4143)
Rewrite "normalize_path()" to remove all intermediate components from the path, ie. "./" and "../". It's very similar in functionality to fs::canonicalize(), however "normalize_path() doesn't resolve symlinks.
Diffstat (limited to 'cli/ops/runtime.rs')
-rw-r--r-- | cli/ops/runtime.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/cli/ops/runtime.rs b/cli/ops/runtime.rs index a888ce9a8..ecdb82fd9 100644 --- a/cli/ops/runtime.rs +++ b/cli/ops/runtime.rs @@ -1,7 +1,6 @@ // Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. use super::dispatch_json::{JsonOp, Value}; use crate::colors; -use crate::fs as deno_fs; use crate::op_error::OpError; use crate::state::State; use crate::version; @@ -33,7 +32,8 @@ fn op_start( let gs = &state.global_state; Ok(JsonOp::Sync(json!({ - "cwd": deno_fs::normalize_path(&env::current_dir().unwrap()), + // TODO(bartlomieju): `cwd` field is not used in JS, remove? + "cwd": &env::current_dir().unwrap(), "pid": std::process::id(), "args": gs.flags.argv.clone(), "repl": gs.flags.subcommand == DenoSubcommand::Repl, |