Skip to content

Commit

Permalink
build: update build
Browse files Browse the repository at this point in the history
  • Loading branch information
oneofthezombies committed Feb 6, 2024
1 parent bec6ba6 commit ad758d5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
13 changes: 2 additions & 11 deletions .cargo-husky/hooks/pre-push
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,5 @@

set -e

echo check
cargo run --package tool-dev -- check

echo clippy
cargo run --package tool-dev -- clippy

echo fmt
cargo run --package tool-dev -- fmt

echo test
cargo run --package tool-dev -- test
echo cargo run --package tool-dev -- pre-push
cargo run --package tool-dev -- pre-push
11 changes: 10 additions & 1 deletion crates/tools/dev/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ enum Commands {
Fmt,
Build { platform: String },
Test { platform: Option<String> },
PrePush,
}

fn run(program: &str, args: &[&str]) {
Expand All @@ -35,7 +36,7 @@ fn run(program: &str, args: &[&str]) {
}
}
Err(e) => {
eprintln!("Error: {e}");
eprintln!("Error: {e:?}");
std::process::exit(1);
}
}
Expand Down Expand Up @@ -129,6 +130,13 @@ fn test(platform: Option<String>) {
}
}

fn pre_push() {
check();
clippy();
fmt();
test(None);
}

fn main() {
let cli = Cli::parse();
match cli.command {
Expand All @@ -137,6 +145,7 @@ fn main() {
Some(Commands::Fmt) => fmt(),
Some(Commands::Build { platform }) => build(&platform),
Some(Commands::Test { platform }) => test(platform),
Some(Commands::PrePush) => pre_push(),
None => {
panic!("No command");
}
Expand Down

0 comments on commit ad758d5

Please sign in to comment.