Skip to content

Instantly share code, notes, and snippets.

@collindonnell
Created January 8, 2013 02:28
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save collindonnell/4480543 to your computer and use it in GitHub Desktop.
Save collindonnell/4480543 to your computer and use it in GitHub Desktop.
Generate and deploy Octopress blog from LaunchBar or other script launcher.
(*
Generate and deploy Octopress site from Launchbar
Author: Collin Donnell
Website: http://collindonnell.com
Date: 01/07/2013
*)
-- Set to the location on disk of your site
set octopressLocation to ((path to home folder as text) & "Code:blog:") as alias
-- Set to the URL of your website
set websiteURL to "http://collindonnell.com"
-- "true" if you want the site to open after publishing, "false" if not
set openWebsiteWhenFinished to true
tell application "Terminal"
activate
-- Run gen_deploy in the root folder of the octopress site
do script "cd " & quoted form of (POSIX path of octopressLocation) & "; rake gen_deploy"
-- Wait for the Terminal window to finish what it's doing
repeat while window 1 is busy
delay 0.25
end repeat
-- Close the Terminal window
close window 1
end tell
-- Show a notification
-- Comment this out if you don't have LaunchBar installed
tell application "LaunchBar" to display in notification center websiteURL with title "Published Octopress Site"
if openWebsiteWhenFinished then
-- Change to your favorite browser
tell application "Safari"
activate
tell window 1
set current tab to (make new tab with properties {URL:websiteURL})
end tell
end tell
end if
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment