Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Commit

Permalink
Skip deno upgrade unless installed under .deno (#750)
Browse files Browse the repository at this point in the history
* Skip deno upgrade unless installed under .deno

* Use base_dirs from execution context
  • Loading branch information
tranzystorekk authored Sep 2, 2021
1 parent 3135a79 commit ad46486
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/steps/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,12 @@ pub fn pnpm_global_update(run_type: RunType) -> Result<()> {

pub fn deno_upgrade(ctx: &ExecutionContext) -> Result<()> {
let deno = require("deno")?;
let deno_dir = ctx.base_dirs().home_dir().join(".deno");

if !deno.canonicalize()?.is_descendant_of(&deno_dir) {
let skip_reason = SkipStep("Deno installed outside of .deno directory".to_string());
return Err(skip_reason.into());
}

print_separator("Deno");
ctx.run_type().execute(&deno).arg("upgrade").check_run()
Expand Down

0 comments on commit ad46486

Please sign in to comment.