Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions integration-tests/clean-all.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/bin/bash

# Clean all Rust contracts in subdirectories
# Runs `cargo clean` and removes Cargo.lock for each contract

set -e

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

echo "Cleaning all Rust contracts in $SCRIPT_DIR"
echo "============================================"

# Find all directories containing Cargo.toml and process them
find "$SCRIPT_DIR" -name "Cargo.toml" -type f | while read -r cargo_file; do
dir="$(dirname "$cargo_file")"

# Skip any target directories (these are build artifacts)
if [[ "$dir" == *"/target/"* ]]; then
continue
fi

echo ""
echo "Cleaning: $dir"

# Run cargo clean
(cd "$dir" && cargo clean 2>/dev/null) || echo " Warning: cargo clean failed in $dir"

# Remove Cargo.lock if it exists
if [ -f "$dir/Cargo.lock" ]; then
rm "$dir/Cargo.lock"
echo " Removed Cargo.lock"
fi
done

echo ""
echo "============================================"
echo "Done! All contracts cleaned."
Loading