Skip to content

Commit

Permalink
feat(volo-cli): auto run cargo fmt --all after generating codes
Browse files Browse the repository at this point in the history
Signed-off-by: Yu Li <liyu.yukiteru@bytedance.com>
  • Loading branch information
yukiiiteru committed Nov 1, 2023
1 parent 24933af commit f9dfcfc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion volo-cli/src/init.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::{fs::create_dir_all, path::PathBuf};
use std::{fs::create_dir_all, path::PathBuf, process::Command};

use clap::{value_parser, Parser};
use volo_build::{
Expand Down Expand Up @@ -273,6 +273,8 @@ impl CliCommand for Init {
PathBuf::from("./volo-gen/").join(DEFAULT_CONFIG_FILE),
)?;

let _ = Command::new("cargo").arg("fmt").arg("--all").output()?;

Ok(())
}
}

0 comments on commit f9dfcfc

Please sign in to comment.