Skip to content

Commit

Permalink
Create README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
sambacha authored May 30, 2024
0 parents commit b8172e0
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# ethereum-tests-xz

ethereum/tests repo but minified and compressed

```bash
#!/bin/bash

# Check if 'jq' is installed
if ! command -v jq &> /dev/null; then
echo "The 'jq' command could not be found. Please install 'jq' to use this script."
exit 1
fi

# Function to minify JSON files
minify_json() {
local file="$1"
tmp_file=$(mktemp)
if jq -c . "$file" > "$tmp_file"; then
mv "$tmp_file" "$file"
echo "Minified: $file"
else
echo "Failed to minify: $file"
rm "$tmp_file"
fi
}

# Export the function so it can be used by 'find' command
export -f minify_json

# Find and minify JSON files recursively from the current directory
find . -type f -name "*.json" -exec bash -c 'minify_json "$0"' {} \;

echo "JSON minification completed."
```

```bash
XZ_OPT='-9' tar -cvJf ethereum-tests.xz /ethereum-tests
```

0 comments on commit b8172e0

Please sign in to comment.