-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit b8172e0
Showing
1 changed file
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
``` |