Skip to content

Commit

Permalink
fix(Run helix as a regular user)
Browse files Browse the repository at this point in the history
Prior to this commit, helix grammars were fetched with sudo privileges.
There is no need for this, and it was also a bug.

Signed-off-by: innocentzero <isfarulhaque@proton.me>
  • Loading branch information
InnocentZero committed Feb 17, 2024
1 parent 7c63541 commit 563ac2f
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/steps/generic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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!")?;

Expand Down

0 comments on commit 563ac2f

Please sign in to comment.