Skip to content

Commit

Permalink
match deno if deno.json file is found
Browse files Browse the repository at this point in the history
  • Loading branch information
coffee-cup committed May 6, 2022
1 parent 2d1ab26 commit bb1359e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/providers/deno.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ impl Provider for DenoProvider {

fn detect(&self, app: &App, _env: &Environment) -> Result<bool> {
let re = Regex::new(r##"(?m)^import .+ from "https://deno.land/[^"]+\.ts";?$"##).unwrap();
app.find_match(&re, "**/*.ts")
Ok(app.includes_file("deno.json")
|| app.includes_file("deno.jsonc")
|| app.find_match(&re, "**/*.ts")?)
}

fn setup(&self, _app: &App, _env: &Environment) -> Result<Option<SetupPhase>> {
Expand Down

0 comments on commit bb1359e

Please sign in to comment.