From 1b8c9bca05444482db42486e941d36fab5f0d484 Mon Sep 17 00:00:00 2001 From: Adar Nimrod <nimrod@shore.co.il> Date: Mon, 27 Nov 2017 15:52:00 +0200 Subject: [PATCH] - Use the json.tool module instead of writing my own one-liner. --- .bashrc | 1 + Documents/bin/json-prettify | 8 -------- 2 files changed, 1 insertion(+), 8 deletions(-) delete mode 100755 Documents/bin/json-prettify diff --git a/.bashrc b/.bashrc index a310984..15ab928 100644 --- a/.bashrc +++ b/.bashrc @@ -76,6 +76,7 @@ alias sudo="sudo " alias presentation='docker run -itv "$PWD:/project" adarnimrod/presentation' alias prune_prerun='find "$HOME" -maxdepth 1 -name ".prerun.*" -print0 | grep -zv "$(pgrep -u "$(id -u)" bash)" | xargs -0r rm ' alias netdata='docker run --detach --name netdata --cap-add SYS_PTRACE --volume /proc:/host/proc:ro --volume /sys:/host/sys:ro --volume /var/run/docker.sock:/var/run/docker.sock --publish 19999:19999 firehol/netdata' +alias json-tool='python3 -m json.tool' deduce_aws_region () { AWS_DEFAULT_REGION="$(python << EOF diff --git a/Documents/bin/json-prettify b/Documents/bin/json-prettify deleted file mode 100755 index f10eafb..0000000 --- a/Documents/bin/json-prettify +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env python3 -'''Get JSON from stdin, output pretty JSON to stdout.''' - -import json -import sys - -if __name__ == '__main__': - print(json.dumps(json.load(sys.stdin), indent=4, sort_keys=True)) -- GitLab