summaryrefslogtreecommitdiff
path: root/cli/tools/vendor/build.rs
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tools/vendor/build.rs')
-rw-r--r--cli/tools/vendor/build.rs11
1 files changed, 0 insertions, 11 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>>;