Added a step for fetching and building treesitter grammars for helix (#263)

This commit is contained in:
sandal
2022-12-14 09:12:39 +01:00
committed by GitHub
parent 1e14b3bf28
commit 9f424f03c3
3 changed files with 22 additions and 0 deletions

View File

@@ -110,6 +110,7 @@ pub enum Step {
Julia,
Juliaup,
Kakoune,
Helix,
Krew,
Macports,
Mas,

View File

@@ -367,6 +367,7 @@ fn run() -> Result<()> {
runner.execute(Step::Vim, "The Ultimate vimrc", || vim::upgrade_ultimate_vimrc(&ctx))?;
runner.execute(Step::Vim, "voom", || vim::run_voom(&base_dirs, run_type))?;
runner.execute(Step::Kakoune, "Kakoune", || kakoune::upgrade_kak_plug(&ctx))?;
runner.execute(Step::Helix, "helix", || generic::run_helix_grammars(&ctx))?;
runner.execute(Step::Node, "npm", || node::run_npm_upgrade(&ctx))?;
runner.execute(Step::Node, "yarn", || node::run_yarn_upgrade(&ctx))?;
runner.execute(Step::Node, "pnpm", || node::run_pnpm_upgrade(&ctx))?;

View File

@@ -499,6 +499,26 @@ pub fn run_dotnet_upgrade(ctx: &ExecutionContext) -> Result<()> {
Ok(())
}
pub fn run_helix_grammars(ctx: &ExecutionContext) -> Result<()> {
utils::require("helix")?;
print_separator("Helix");
ctx.run_type()
.execute(ctx.sudo().as_ref().ok_or(TopgradeError::SudoRequired)?)
.args(["helix", "--grammar", "fetch"])
.status_checked()
.with_context(|| "Failed to download helix grammars!")?;
ctx.run_type()
.execute(ctx.sudo().as_ref().ok_or(TopgradeError::SudoRequired)?)
.args(["helix", "--grammar", "build"])
.status_checked()
.with_context(|| "Failed to build helix grammars!")?;
Ok(())
}
pub fn run_raco_update(run_type: RunType) -> Result<()> {
let raco = utils::require("raco")?;