setup `~/.local/bin` to be loaded in .zshrc
How to setup
Here is the script:
\#!/usr/bin/env bash
if [ $\# -ne 1 ]; then
echo "Usage: $0 <json_file>"
exit 1
fi
input_file="$1"
\# Does the file exists?
if [ ! -f "$input_file" ]; then
echo "Error: File '$input_file' not found"
exit 1
fi
\# is jq installed ?
if ! command -v jq &> /dev/null; then
echo "Error: jq is not installed. Please install it first."
exit 1
fi
\# Process the JSON file
jq -r '.http_interactions[0].response.body.string' "$input_file" | jq '.'