mirror of
https://github.com/denoland/deno.git
synced 2025-03-09 21:57:40 -04:00
wip
This commit is contained in:
parent
d9b130410b
commit
4a76234681
2 changed files with 14 additions and 6 deletions
|
@ -156,6 +156,19 @@ pub const IGNORED_RUNTIME_COMPILER_OPTIONS: &[&str] = &[
|
||||||
"watch",
|
"watch",
|
||||||
];
|
];
|
||||||
|
|
||||||
|
pub fn discover(flags: &crate::Flags) -> Result<Option<ConfigFile>, AnyError> {
|
||||||
|
if let Some(config_path) = flags.config_path.as_ref() {
|
||||||
|
Ok(Some(ConfigFile::read(config_path)?))
|
||||||
|
} else {
|
||||||
|
if let DenoSubcommand::Fmt { files, ... } = flags.subcommand {
|
||||||
|
} else if let DenoSubcommand::Lint { files, ... } = flags.subcommand {
|
||||||
|
} else {
|
||||||
|
todo!()
|
||||||
|
}
|
||||||
|
Ok(None)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// A function that works like JavaScript's `Object.assign()`.
|
/// A function that works like JavaScript's `Object.assign()`.
|
||||||
pub fn json_merge(a: &mut Value, b: &Value) {
|
pub fn json_merge(a: &mut Value, b: &Value) {
|
||||||
match (a, b) {
|
match (a, b) {
|
||||||
|
|
|
@ -206,12 +206,7 @@ impl ProcState {
|
||||||
None
|
None
|
||||||
};
|
};
|
||||||
|
|
||||||
let maybe_config_file =
|
let maybe_config_file = crate::config_file::discover(&flags)?;
|
||||||
if let Some(config_path) = flags.config_path.as_ref() {
|
|
||||||
Some(ConfigFile::read(config_path)?)
|
|
||||||
} else {
|
|
||||||
None
|
|
||||||
};
|
|
||||||
|
|
||||||
let maybe_import_map: Option<Arc<ImportMap>> =
|
let maybe_import_map: Option<Arc<ImportMap>> =
|
||||||
match flags.import_map_path.as_ref() {
|
match flags.import_map_path.as_ref() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue