Skip to content

Instantly share code, notes, and snippets.

@SheffieldKevin
Last active August 29, 2015 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SheffieldKevin/3089c7f88b045052de32 to your computer and use it in GitHub Desktop.
Save SheffieldKevin/3089c7f88b045052de32 to your computer and use it in GitHub Desktop.
Coda run the current document in ruby plugin script
#!/usr/bin/env ruby
# This is the script code to run. It runs the script based on the file path to the script not text passed in.
# In Panic's "Coda Plug-in Creator" I've set the following options:
# Command is: Run Document
# Keyboard shortcut: Command-Option-R
# On Run: Save
# On Success: Nothing
# STDIN None
# STDOUT New Document
$stdout.flush
search_path = ENV['PATH'].dup
search_path = "/usr/local/bin:#{search_path}"
ENV['PATH'] = search_path
filepath = ENV['CODA_FILEPATH']
puts `#{filepath} 2>&1`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment