Created
October 19, 2010 12:19
-
-
Save ctrochalakis/634098 to your computer and use it in GitHub Desktop.
Rake task to generate an html branch for jekyll
This file contains 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
desc "Commit website to html branch" | |
task :html do | |
system <<-GITFOO | |
test -e 'for_html' && rm -rf for_html | |
test -e '.git/html.index' && rm .git/html.index | |
jekyll --no-auto for_html | |
export GIT_INDEX_FILE=.git/html.index | |
git add -f for_html | |
tree_id=$(git write-tree --prefix=for_html/) | |
new_commit=$(echo "New website!"|git commit-tree $tree_id -p refs/heads/html) | |
git update-ref refs/heads/html $new_commit | |
test -e 'for_html' && rm -rf for_html | |
test -e '.git/html.index' && rm .git/html.index | |
GITFOO | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment