Skip to content

Commit

Permalink
If syntax submodules don't exist at all, initialize them
Browse files Browse the repository at this point in the history
  • Loading branch information
Nemo157 authored and syphar committed Nov 13, 2022
1 parent a0ff6c1 commit 603946c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,16 @@ fn compile_syntax(out_dir: &Path) -> Result<()> {
parsing::{SyntaxDefinition, SyntaxSetBuilder},
};

if std::fs::metadata("assets/syntaxes").is_err() {
let status = std::process::Command::new("git")
.args(["submodule", "update", "--init"])
.status()
.context("attempting to initialize submodules")?;
if !status.success() {
return Err(anyhow::anyhow!("initializing submodules failed"));
}
}

fn tracked_add_from_folder(
builder: &mut SyntaxSetBuilder,
path: impl AsRef<Path>,
Expand Down

0 comments on commit 603946c

Please sign in to comment.