From 12b0fa57ad6f1cc51d78af6287fb0bcc6ef4c7e1 Mon Sep 17 00:00:00 2001 From: Md Isfarul Haque Date: Fri, 23 Feb 2024 04:56:08 +0530 Subject: [PATCH] fix: fetch and build Helix grammar as a regular user (#698) --- src/steps/generic.rs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/steps/generic.rs b/src/steps/generic.rs index 515e2a11..99ef3daa 100644 --- a/src/steps/generic.rs +++ b/src/steps/generic.rs @@ -796,20 +796,19 @@ pub fn run_dotnet_upgrade(ctx: &ExecutionContext) -> Result<()> { } pub fn run_helix_grammars(ctx: &ExecutionContext) -> Result<()> { - require("helix")?; + let helix = require("helix")?; print_separator("Helix"); - let sudo = require_option(ctx.sudo().as_ref(), REQUIRE_SUDO.to_string())?; ctx.run_type() - .execute(sudo) - .args(["helix", "--grammar", "fetch"]) + .execute(&helix) + .args(["--grammar", "fetch"]) .status_checked() .with_context(|| "Failed to download helix grammars!")?; ctx.run_type() - .execute(sudo) - .args(["helix", "--grammar", "build"]) + .execute(&helix) + .args(["--grammar", "build"]) .status_checked() .with_context(|| "Failed to build helix grammars!")?;