Completed clean root directory structure: - Root now contains only: .git, .env, docs/, orig/ - Moved all remaining files and directories to orig/: - Config files (.claude, .dockerignore, .drone.yml, etc.) - All .env variants (except active .env) - Git config (.gitconfig, .github, .gitignore, etc.) - Tool configs (.golangci.yml, .revive.toml, etc.) - Documentation (*.md files, @prompts) - Build files (Dockerfiles, Makefile, go.mod, go.sum) - Docker compose files - All source directories (scripts, tests, tools, etc.) - Runtime directories (logs, monitoring, reports) - Dependency files (node_modules, lib, cache) - Special files (--delete) - Removed empty runtime directories (bin/, data/) V2 structure is now clean: - docs/planning/ - V2 planning documents - orig/ - Complete V1 codebase preserved - .env - Active environment config (not in git) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
55 lines
1.4 KiB
Bash
Executable File
55 lines
1.4 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# View Latest Archive - Extract and browse the most recent log archive
|
|
# Usage: ./scripts/view-latest-archive.sh [pattern]
|
|
|
|
ARCHIVE_DIR="logs/archives"
|
|
TEMP_DIR="/tmp/mev_archive_view"
|
|
PATTERN="${1:-}"
|
|
|
|
if [[ ! -f "$ARCHIVE_DIR/latest_archive.tar.gz" ]]; then
|
|
echo "❌ No archive found. Run ./scripts/archive-logs.sh first."
|
|
exit 1
|
|
fi
|
|
|
|
echo "📂 Extracting latest archive for viewing..."
|
|
rm -rf "$TEMP_DIR"
|
|
mkdir -p "$TEMP_DIR"
|
|
cd "$TEMP_DIR"
|
|
|
|
# Extract archive
|
|
tar -xzf "$OLDPWD/$ARCHIVE_DIR/latest_archive.tar.gz"
|
|
|
|
ARCHIVE_NAME=$(ls | head -1)
|
|
cd "$ARCHIVE_NAME"
|
|
|
|
echo "✅ Archive extracted to: $TEMP_DIR/$ARCHIVE_NAME"
|
|
echo
|
|
|
|
if [[ -n "$PATTERN" ]]; then
|
|
echo "🔍 Searching for pattern: $PATTERN"
|
|
echo "================================================"
|
|
grep -r "$PATTERN" . --color=always | head -20
|
|
echo
|
|
echo "📊 Pattern summary:"
|
|
grep -r "$PATTERN" . | wc -l | xargs echo "Total matches:"
|
|
else
|
|
echo "📋 Archive contents:"
|
|
ls -la
|
|
echo
|
|
echo "📊 Archive summary:"
|
|
echo "- Log files: $(ls *.log 2>/dev/null | wc -l)"
|
|
echo "- Total size: $(du -sh . | cut -f1)"
|
|
|
|
if [[ -f "archive_metadata.json" ]]; then
|
|
echo
|
|
echo "📈 Metadata excerpt:"
|
|
cat archive_metadata.json | head -20
|
|
fi
|
|
fi
|
|
|
|
echo
|
|
echo "💡 Tips:"
|
|
echo " View specific log: cat $TEMP_DIR/$ARCHIVE_NAME/mev_bot.log"
|
|
echo " Search pattern: $0 'DIRECT PARSING'"
|
|
echo " Cleanup: rm -rf $TEMP_DIR" |