From 98e0ed54db5bbd8befcb5afbb1d63f2b80677f51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Thu, 16 Jul 2020 10:53:07 +0200 Subject: fix: ModuleSpecifier removes relative path parts (#6762) --- cli/fs.rs | 2 ++ cli/main.rs | 11 +---------- 2 files changed, 3 insertions(+), 10 deletions(-) (limited to 'cli') diff --git a/cli/fs.rs b/cli/fs.rs index 83dec4913..2aedf1e34 100644 --- a/cli/fs.rs +++ b/cli/fs.rs @@ -46,6 +46,8 @@ pub fn write_file_2>( file.write_all(data.as_ref()) } +/// IMPORTANT: This method is duplicated in core/module_specifier.rs +/// /// Normalize all itermediate components of the path (ie. remove "./" and "../" components). /// Similar to `fs::canonicalize()` but doesn't resolve symlinks. /// diff --git a/cli/main.rs b/cli/main.rs index 088d65ecd..cf25ed324 100644 --- a/cli/main.rs +++ b/cli/main.rs @@ -440,16 +440,7 @@ async fn bundle_command( source_file: String, out_file: Option, ) -> Result<(), ErrBox> { - let mut module_specifier = - ModuleSpecifier::resolve_url_or_path(&source_file)?; - let url = module_specifier.as_url(); - - // TODO(bartlomieju): fix this hack in ModuleSpecifier - if url.scheme() == "file" { - let a = deno_fs::normalize_path(&url.to_file_path().unwrap()); - let u = Url::from_file_path(a).unwrap(); - module_specifier = ModuleSpecifier::from(u) - } + let module_specifier = ModuleSpecifier::resolve_url_or_path(&source_file)?; debug!(">>>>> bundle START"); let global_state = GlobalState::new(flags)?; -- cgit v1.2.3