summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2014-01-12 21:57:04 +0100
committerJonas Smedegaard <dr@jones.dk>2014-01-12 21:57:04 +0100
commit6989ba06ec5cc2b651b695c8fb5ccb378c27f33a (patch)
treeccedf4f560df63d0b4110bd933b10bc5ee731ecf
parentf514d1b8dfa19cb1f5c46ae12bc122c09a3a8e17 (diff)
Fix use jq as tidier (jshon un-rounds numbers).
-rwxr-xr-xlocaltidygeojson7
1 files changed, 4 insertions, 3 deletions
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 <http://www.gnu.org/licenses/>.
#
-# 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"