185cb6e37352cc0d92042e35d259b0de3f5f3886

Author
Bob Williams <bobwilliams.ii@gmail.com>
Committer
Bob Williams <bobwilliams.ii@gmail.com>
Date

Message

adding support for node

Diff

 1diff --git a/plugins/jsontools/jsontools.plugin.zsh b/plugins/jsontools/jsontools.plugin.zsh
 2index 51578b3493182c251c555a7b4d0950959fef5097..7b6f8c585d8737a8314f8129e2aa5945fd2ba3d2 100644
 3--- a/plugins/jsontools/jsontools.plugin.zsh
 4+++ b/plugins/jsontools/jsontools.plugin.zsh
 5@@ -5,7 +5,9 @@ if [[ $(whence $JSONTOOLS_METHOD) = "" ]]; then
 6     JSONTOOLS_METHOD=""
 7 fi
 8 
 9-if [[ $(whence python) != "" && ( "x$JSONTOOLS_METHOD" = "x" || "x$JSONTOOLS_METHOD" = "xpython" ) ]]; then
10+if [[ $(whence node) != "" && ( "x$JSONTOOLS_METHOD" = "x"  || "x$JSONTOOLS_METHOD" = "xnode" ) ]]; then
11+    alias pp_json='node -e "console.log(JSON.stringify(process.argv[1]), null, 4)"'
12+elif [[ $(whence python) != "" && ( "x$JSONTOOLS_METHOD" = "x" || "x$JSONTOOLS_METHOD" = "xpython" ) ]]; then
13 	alias pp_json='python -mjson.tool'
14 elif [[ $(whence ruby) != "" && ( "x$JSONTOOLS_METHOD" = "x" || "x$JSONTOOLS_METHOD" = "xruby" ) ]]; then
15 	alias pp_json='ruby -e "require \"json\"; require \"yaml\"; puts JSON.parse(STDIN.read).to_yaml"'