summaryrefslogtreecommitdiff
path: root/cli/tools
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tools')
-rw-r--r--cli/tools/vendor/build.rs11
-rw-r--r--cli/tools/vendor/test.rs8
2 files changed, 0 insertions, 19 deletions
diff --git a/cli/tools/vendor/build.rs b/cli/tools/vendor/build.rs
index 1646a9959..0590992b0 100644
--- a/cli/tools/vendor/build.rs
+++ b/cli/tools/vendor/build.rs
@@ -2,7 +2,6 @@
use std::fmt::Write as _;
use std::path::Path;
-use std::path::PathBuf;
use std::sync::Arc;
use deno_ast::ModuleSpecifier;
@@ -34,19 +33,13 @@ use super::specifiers::is_remote_specifier;
/// Allows substituting the environment for testing purposes.
pub trait VendorEnvironment {
- fn cwd(&self) -> Result<PathBuf, AnyError>;
fn create_dir_all(&self, dir_path: &Path) -> Result<(), AnyError>;
fn write_file(&self, file_path: &Path, bytes: &[u8]) -> Result<(), AnyError>;
- fn path_exists(&self, path: &Path) -> bool;
}
pub struct RealVendorEnvironment;
impl VendorEnvironment for RealVendorEnvironment {
- fn cwd(&self) -> Result<PathBuf, AnyError> {
- Ok(std::env::current_dir()?)
- }
-
fn create_dir_all(&self, dir_path: &Path) -> Result<(), AnyError> {
Ok(std::fs::create_dir_all(dir_path)?)
}
@@ -55,10 +48,6 @@ impl VendorEnvironment for RealVendorEnvironment {
std::fs::write(file_path, bytes)
.with_context(|| format!("Failed writing {}", file_path.display()))
}
-
- fn path_exists(&self, path: &Path) -> bool {
- path.exists()
- }
}
type BuildGraphFuture = LocalBoxFuture<'static, Result<ModuleGraph, AnyError>>;
diff --git a/cli/tools/vendor/test.rs b/cli/tools/vendor/test.rs
index c5e98c05e..d54bf5dc5 100644
--- a/cli/tools/vendor/test.rs
+++ b/cli/tools/vendor/test.rs
@@ -144,10 +144,6 @@ struct TestVendorEnvironment {
}
impl VendorEnvironment for TestVendorEnvironment {
- fn cwd(&self) -> Result<PathBuf, AnyError> {
- Ok(make_path("/"))
- }
-
fn create_dir_all(&self, dir_path: &Path) -> Result<(), AnyError> {
let mut directories = self.directories.borrow_mut();
for path in dir_path.ancestors() {
@@ -169,10 +165,6 @@ impl VendorEnvironment for TestVendorEnvironment {
);
Ok(())
}
-
- fn path_exists(&self, path: &Path) -> bool {
- self.files.borrow().contains_key(&path.to_path_buf())
- }
}
pub struct VendorOutput {