From 26ecbea5780dfe0c0b1bb56b997f3824d288a639 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Mon, 14 Feb 2022 19:47:14 -0500 Subject: [PATCH] Maybe fix mac. --- cli/tests/integration/vendor_tests.rs | 9 +++++---- cli/tools/vendor/mod.rs | 8 +++++++- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/cli/tests/integration/vendor_tests.rs b/cli/tests/integration/vendor_tests.rs index 889bd30d3bf2c7..80ce455bc666de 100644 --- a/cli/tests/integration/vendor_tests.rs +++ b/cli/tests/integration/vendor_tests.rs @@ -2,6 +2,7 @@ use deno_core::serde_json; use deno_core::serde_json::json; +use deno_runtime::fs_util; use pretty_assertions::assert_eq; use std::fs; use std::process::Stdio; @@ -30,11 +31,11 @@ fn output_dir_exists() { String::from_utf8_lossy(&output.stderr).trim(), format!( concat!( - "error: Directory {} was not empty. Please provide an empty ", + "error: Output directory {} was not empty. Please provide an empty ", "directory or use --force to ignore this error and potentially ", "overwrite its contents.", ), - vendor_dir.display(), + fs_util::canonicalize_path(&vendor_dir).unwrap().display(), ), ); assert!(!output.status.success()); @@ -55,11 +56,11 @@ fn output_dir_exists() { String::from_utf8_lossy(&output.stderr).trim(), format!( concat!( - "error: Directory {} was not empty. Please provide an empty ", + "error: Output directory {} was not empty. Please provide an empty ", "directory or use --force to ignore this error and potentially ", "overwrite its contents.", ), - vendor_dir.display(), + fs_util::canonicalize_path(&vendor_dir).unwrap().display(), ), ); assert!(!output.status.success()); diff --git a/cli/tools/vendor/mod.rs b/cli/tools/vendor/mod.rs index e46b9938405d39..284e2f7442d421 100644 --- a/cli/tools/vendor/mod.rs +++ b/cli/tools/vendor/mod.rs @@ -39,7 +39,13 @@ fn resolve_and_validate_output_dir( None => std::env::current_dir()?.join("vendor"), }; if !flags.force && !is_dir_empty(&output_dir)? { - bail!("Directory {} was not empty. Please provide an empty directory or use --force to ignore this error and potentially overwrite its contents.", output_dir.display()); + bail!( + concat!( + "Output directory {} was not empty. Please provide an empty directory or use ", + "--force to ignore this error and potentially overwrite its contents.", + ), + output_dir.display(), + ); } // check the import map