mirror of
https://github.com/Noratrieb/haesli.git
synced 2026-01-16 04:35:03 +01:00
add yarn install to formatting
This commit is contained in:
parent
4f5f9d6513
commit
8070cfc2a9
4 changed files with 43 additions and 20 deletions
|
|
@ -1,4 +1,8 @@
|
|||
use std::path::PathBuf;
|
||||
use anyhow::{ensure, Context, Result};
|
||||
use std::{
|
||||
path::{Path, PathBuf},
|
||||
process::Command,
|
||||
};
|
||||
|
||||
mod check_fmt;
|
||||
mod codegen;
|
||||
|
|
@ -43,3 +47,14 @@ pub fn project_root() -> PathBuf {
|
|||
.expect("project root path")
|
||||
.to_path_buf()
|
||||
}
|
||||
|
||||
pub fn yarn_install(path: &Path) -> Result<()> {
|
||||
let status = Command::new("yarn")
|
||||
.arg("install")
|
||||
.current_dir(path)
|
||||
.status()
|
||||
.context("run yarn install failed")?;
|
||||
|
||||
ensure!(status.success(), "Failed to build frontend");
|
||||
Ok(())
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue