milvus/scripts/run_cargo_format.sh
aoiasd 097f4ce17a
fix: rustcheck not work in CI (#43302)
relate: https://github.com/milvus-io/milvus/issues/42806

Signed-off-by: aoiasd <zhicheng.yue@zilliz.com>
2025-07-16 14:32:50 +08:00

17 lines
299 B
Bash

#!/bin/bash
(
cd "$1" || exit 1
if [ "$2" == "--check" ]; then
if ! cargo fmt --all -- --check; then
echo "Rust code is not properly formatted."
exit 1
fi
echo "Check rust format success"
else
cargo fmt --all
fi
exit 0
)