From b2d385d9717bfdd381436393325bcab389418bc8 Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Sat, 24 Jan 2026 05:50:52 +0800 Subject: Add timing and suppress output in deployment scripts --- scripts/dev/deploy.sh | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'scripts/dev/deploy.sh') diff --git a/scripts/dev/deploy.sh b/scripts/dev/deploy.sh index 429ea0a..b8e4640 100644 --- a/scripts/dev/deploy.sh +++ b/scripts/dev/deploy.sh @@ -2,6 +2,9 @@ # Require : Cargo (Rust) +# Start timing +start_time=$(date +%s.%N) + # Change to the directory where the script is located cd "$(dirname "$0")/../../" || exit 1 @@ -14,7 +17,7 @@ fi # Test core library echo "Testing Core Library \"../VersionControl/Cargo.toml\"" -cargo test --manifest-path ../VersionControl/Cargo.toml --workspace --quiet +cargo test --manifest-path ../VersionControl/Cargo.toml --workspace --quiet > /dev/null 2>&1 if [ $? -ne 0 ]; then echo "Core library tests failed. Aborting build." exit 1 @@ -22,7 +25,7 @@ fi # Test workspace echo "Testing Command Line \"./Cargo.toml\"" -cargo test --workspace --quiet +cargo test --workspace --quiet > /dev/null 2>&1 if [ $? -ne 0 ]; then echo "Workspace tests failed. Aborting build." exit 1 @@ -45,13 +48,18 @@ if [ -n "$core_git_status" ]; then fi # Build -echo "Building \"./Cargo.toml\"" -if FORCE_BUILD=$(date +%s) cargo build --workspace --release --quiet; then +echo "Building Command Line \"./Cargo.toml\"" +if FORCE_BUILD=$(date +%s) cargo build --workspace --release --quiet > /dev/null 2>&1; then # Build succeeded # Export - echo "Deploying \"./.cargo/config.toml\"" - if cargo run --manifest-path tools/build_helper/Cargo.toml --quiet --bin exporter release; then + echo "Deploying Command Line \"./.cargo/config.toml\"" + if cargo run --manifest-path tools/build_helper/Cargo.toml --quiet --bin exporter release > /dev/null 2>&1; then # Copy compile_info.rs.template to compile_info.rs after successful export cp -f templates/compile_info.rs.template src/data/compile_info.rs fi fi + +# Calculate and display elapsed time +end_time=$(date +%s.%N) +elapsed_time=$(echo "$end_time - $start_time" | bc) +printf "Success (Finished in %.2fs)\n" $elapsed_time -- cgit