mirror of
https://github.com/ultraworkers/claw-code.git
synced 2026-04-29 08:08:14 +08:00
The formatting wrapper should remain safe when invoked through different current directories or shell contexts, so resolve the script directory before entering the Rust workspace and forwarding cargo fmt arguments. Constraint: Wrapper must be runnable from repo root while forwarding flags like --check Rejected: Leave relative dirname cd | less robust if invocation context changes Confidence: high Scope-risk: narrow Tested: scripts/fmt.sh --check Tested: git diff --check
8 lines
181 B
Bash
Executable File
8 lines
181 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
REPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
|
|
cd "$REPO_ROOT/rust"
|
|
exec cargo fmt "$@"
|