Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Pipe `jshint` output of BBEdit's current document into a BBEdit results window
(* https://readmeansrun.com *)
try
tell application "BBEdit"
set mydoc to file of (document 1 of window 1)
end tell
set posixPath to POSIX path of mydoc
if (posixPath ends with ".js" or posixPath ends with ".json") then
set cmd to "/usr/local/bin/node /usr/local/bin/jshint " & (quoted form of POSIX path of mydoc) & " | /usr/local/bin/bbresults -e --pattern '(?P<file>.+?):\\sline\\s(?P<line>\\d+),\\scol\\s((?P<col>\\d+),)?\\s+(?P<msg>.*)$'"
do shell script cmd
end if
on error
beep
end try
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.