add yarn install to formatting

This commit is contained in:
nora 2022-03-06 17:38:34 +01:00
parent 4f5f9d6513
commit 8070cfc2a9
4 changed files with 43 additions and 20 deletions

View file

@ -1,4 +1,4 @@
use crate::project_root;
use crate::{project_root, yarn_install};
use anyhow::ensure;
use std::process::Command;
@ -10,17 +10,21 @@ pub fn main() -> anyhow::Result<()> {
.status()?;
ensure!(status.success(), "`cargo fmt` did not exit successfully");
let test_js = project_root().join("test-js");
yarn_install(&test_js)?;
println!("$ yarn fmt");
let status = Command::new("yarn")
.arg("fmt")
.current_dir(project_root().join("test-js"))
.current_dir(test_js)
.status()?;
ensure!(status.success(), "`yarn fmt` did not exist successfully");
let frontend = project_root().join("amqp_dashboard/frontend");
yarn_install(&frontend)?;
println!("$ yarn fmt");
let status = Command::new("yarn")
.arg("fmt")
.current_dir(project_root().join("amqp_dashboard/frontend"))
.current_dir(frontend)
.status()?;
ensure!(status.success(), "`yarn fmt` did not exist successfully");