-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdev.sh
More file actions
executable file
·74 lines (70 loc) · 1.63 KB
/
dev.sh
File metadata and controls
executable file
·74 lines (70 loc) · 1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#!/usr/bin/env bash
# Simplified development helper script
set -e # Exit on error
function show_help() {
echo "Development Helper Script for intercept-bounce"
echo "Usage: ./dev.sh [command]"
echo
echo "Commands:"
echo " fmt Format code with rustfmt"
echo " check Run cargo check"
echo " clippy Run clippy lints"
echo " test Run tests"
echo " docs Generate documentation"
echo " build Build the project"
echo " nix Build with Nix"
echo " all Run all checks: fmt, clippy, test"
echo " clean Clean build artifacts"
echo " help Show this help message"
echo
echo "Examples:"
echo " ./dev.sh all # Run all checks"
echo " ./dev.sh build # Build the project"
}
# Ensure we're in the project root
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$SCRIPT_DIR"
# Process command
case "${1:-help}" in
fmt)
echo "Formatting code..."
cargo fmt --all
;;
check)
echo "Running cargo check..."
cargo check --all
;;
clippy)
echo "Running clippy lints..."
cargo clippy --all-targets -- -D warnings
;;
test)
echo "Running tests..."
cargo test --all
;;
docs)
echo "Generating documentation..."
cargo run --package xtask --bin xtask -- generate-docs
;;
build)
echo "Building in release mode..."
cargo build --release
;;
nix)
echo "Building with Nix..."
nix build
;;
all)
echo "Running all checks..."
./dev.sh fmt
./dev.sh clippy
./dev.sh test
;;
clean)
echo "Cleaning build artifacts..."
cargo clean
;;
help|*)
show_help
;;
esac