Skip to content

Instantly share code, notes, and snippets.

@shawnhank
Forked from seiz/00)JSON Syntax Check.sh
Created November 23, 2021 20:28
Show Gist options
  • Save shawnhank/2cecff532a4407868456a3af7cba4ad2 to your computer and use it in GitHub Desktop.
Save shawnhank/2cecff532a4407868456a3af7cba4ad2 to your computer and use it in GitHub Desktop.
BBedit Script to syntax check a JSON-File with jsonlint. Thanks to the new "bbresults", this is a piece of cake.
#!/bin/bash
/usr/local/bin/jsonlint -cq 2>&1 "$BB_DOC_PATH" | bbresults -e --pattern '(?P<file>.+?):\sline\s(?P<line>\d+),\scol\s((?P<col>\d+),)?\s+(?P<msg>.*)$'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment