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 committed Nov 11, 2022
1 parent 18f5989 commit a4b539a
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 a4b539a

Please sign in to comment.