summaryrefslogtreecommitdiff
path: root/scripts/dev/deploy.sh
diff options
context:
space:
mode:
author魏曹先生 <1992414357@qq.com>2026-01-24 05:50:52 +0800
committer魏曹先生 <1992414357@qq.com>2026-01-24 05:50:52 +0800
commitb2d385d9717bfdd381436393325bcab389418bc8 (patch)
treefb4796d0f07ff32d6379fa4f794a62ab9c356a15 /scripts/dev/deploy.sh
parent7aa5f292adbd0328e815a034c3300175849c8f36 (diff)
Add timing and suppress output in deployment scripts
Diffstat (limited to 'scripts/dev/deploy.sh')
-rw-r--r--scripts/dev/deploy.sh20
1 files changed, 14 insertions, 6 deletions
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