From 6989ba06ec5cc2b651b695c8fb5ccb378c27f33a Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Sun, 12 Jan 2014 21:57:04 +0100 Subject: Fix use jq as tidier (jshon un-rounds numbers). --- localtidygeojson | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'localtidygeojson') diff --git a/localtidygeojson b/localtidygeojson index 7a5147c..9cc0a1e 100755 --- a/localtidygeojson +++ b/localtidygeojson @@ -16,9 +16,10 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . # -# Depends: jshon +# Depends: jq set -eu -jshon -SIF "$1" -perl -0 -i -pe 's/},\s*{/}, {/g; s/\[\s*([\d.,]+)\s*([\d.]+)\s*\]/[$1 $2]/g' "$1" +jq . "$1" > "$1"~ +perl -0 -i -pe 's/ /\t/g; s/},\s*{/}, {/g; s/\[\s*([\d.,]+)\s*([\d.]+)\s*\]/[$1 $2]/g' "$1"~ +mv -f "$1"~ "$1" -- cgit v1.2.3