mirror of
https://github.com/Noratrieb/haesli.git
synced 2026-01-14 19:55:03 +01:00
xtask fmt
This commit is contained in:
parent
9a819bc3f4
commit
33d1ef820b
3 changed files with 39 additions and 12 deletions
29
xtask/src/fmt.rs
Normal file
29
xtask/src/fmt.rs
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
use crate::project_root;
|
||||
use anyhow::ensure;
|
||||
use std::process::Command;
|
||||
|
||||
pub fn main() -> anyhow::Result<()> {
|
||||
println!("$ cargo fmt");
|
||||
let status = Command::new("cargo")
|
||||
.arg("fmt")
|
||||
.current_dir(project_root())
|
||||
.status()?;
|
||||
ensure!(status.success(), "`cargo fmt` did not exit successfully");
|
||||
|
||||
println!("$ yarn fmt");
|
||||
let status = Command::new("yarn")
|
||||
.arg("fmt")
|
||||
.current_dir(project_root().join("test-js"))
|
||||
.status()?;
|
||||
ensure!(status.success(), "`yarn fmt` did not exist successfully");
|
||||
|
||||
println!("$ prettier -w .");
|
||||
let status = Command::new("prettier")
|
||||
.arg("-w")
|
||||
.arg(".")
|
||||
.current_dir(project_root().join("amqp_dashboard/assets"))
|
||||
.status()?;
|
||||
ensure!(status.success(), "`prettier .` did not exist successfully");
|
||||
|
||||
Ok(())
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue