Created
May 16, 2012 09:06
-
-
Save jtratner/2708914 to your computer and use it in GitHub Desktop.
Create and edit an octopress post from anywhere (and avoid zsh globbing issues)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/zsh | |
# export BLOG="/path/to/your/octopress/install" | |
# handles globbing weirdness with zsh + use it from anywhere | |
# use: new-post "This is my exciting new post!!!" | |
# set the blog variable to your octopress directory | |
# TODO: fix this so it handles double-titling | |
function new-post () { | |
echo "Creating a new_post titled '$1'." | |
cd $BLOG/ | |
newpost=$(bundle exec rake "new_post[$1]" | awk '{print $4}') | |
$EDITOR $BLOG/$newpost | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I was not able to get yours to work, however, I did modify it successfully : https://gist.github.com/4464271