summaryrefslogtreecommitdiff
path: root/cli/flags.rs
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2019-07-18 00:15:30 +0200
committerRyan Dahl <ry@tinyclouds.org>2019-07-17 18:15:30 -0400
commit8214b686cea3f6ad57d7da49a44d33185fdeb098 (patch)
tree00517c7b8f4bb835ce050e89f29ec1826bac92ce /cli/flags.rs
parent481a82c983e40201589e105e28be4ce809e46a60 (diff)
Refactor DenoDir (#2636)
* rename `ModuleMetaData` to `SourceFile` and remove TS specific functionality * add `TsCompiler` struct encapsulating processing of TypeScript files * move `SourceMapGetter` trait implementation to `//cli/compiler.rs` * add low-level `DiskCache` API for general purpose caches and use it in `DenoDir` and `TsCompiler` for filesystem access * don't use hash-like filenames for compiled modules, instead use metadata file for storing compilation hash * add `SourceFileCache` for in-process caching of loaded files for fast subsequent access * define `SourceFileFetcher` trait encapsulating loading of local and remote files and implement it for `DenoDir` * define `use_cache` and `no_fetch` flags on `DenoDir` instead of using in fetch methods
Diffstat (limited to 'cli/flags.rs')
-rw-r--r--cli/flags.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/cli/flags.rs b/cli/flags.rs
index 704ef1f56..a666ffe67 100644
--- a/cli/flags.rs
+++ b/cli/flags.rs
@@ -5,7 +5,7 @@ use clap::Arg;
use clap::ArgMatches;
use clap::Shell;
use clap::SubCommand;
-use crate::deno_dir;
+use crate::fs as deno_fs;
use deno::ModuleSpecifier;
use log::Level;
use std;
@@ -419,7 +419,7 @@ Example:
fn resolve_paths(paths: Vec<String>) -> Vec<String> {
let mut out: Vec<String> = vec![];
for pathstr in paths.iter() {
- let result = deno_dir::resolve_from_cwd(pathstr);
+ let result = deno_fs::resolve_from_cwd(pathstr);
if result.is_err() {
eprintln!("Unrecognized path to whitelist: {}", pathstr);
continue;
@@ -1161,7 +1161,7 @@ mod tests {
use tempfile::TempDir;
let temp_dir = TempDir::new().expect("tempdir fail");
let (_, temp_dir_path) =
- deno_dir::resolve_from_cwd(temp_dir.path().to_str().unwrap()).unwrap();
+ deno_fs::resolve_from_cwd(temp_dir.path().to_str().unwrap()).unwrap();
let (flags, subcommand, argv) = flags_from_vec(svec![
"deno",
@@ -1186,7 +1186,7 @@ mod tests {
use tempfile::TempDir;
let temp_dir = TempDir::new().expect("tempdir fail");
let (_, temp_dir_path) =
- deno_dir::resolve_from_cwd(temp_dir.path().to_str().unwrap()).unwrap();
+ deno_fs::resolve_from_cwd(temp_dir.path().to_str().unwrap()).unwrap();
let (flags, subcommand, argv) = flags_from_vec(svec![
"deno",