From b73400b0ac5135fcd260b89a660eef2b2ec6399c Mon Sep 17 00:00:00 2001 From: John Bintz Date: Tue, 13 Mar 2012 13:31:33 -0400 Subject: [PATCH] some updates --- bin/attentive | 25 +++++++++++++++++++++++++ skel/.gitignore | 1 + views/_footer.haml | 0 3 files changed, 26 insertions(+) create mode 100644 views/_footer.haml diff --git a/bin/attentive b/bin/attentive index 30de352..76bccf8 100755 --- a/bin/attentive +++ b/bin/attentive @@ -88,6 +88,31 @@ class Attentive::CLI < Thor File.open(target, 'wb') { |fh| response.last.each { |part| fh.print part } } end end + + desc "gh-pages", "Commit the static site to the associated GitHub pages account" + def gh_pages + static + + target = "/tmp/attentive-#{Time.now.to_i}" + + system %{cp -Rpv _site #{target}} + + system %{git checkout gh-pages} + if $?.exitstatus == 1 + puts "Creating gh-pages branch..." + system %{git add . && git commit -a -m "pre-gh pages creation"} + + system %{git symbolic-ref HEAD refs/heads/gh-pages} + system %{rm .git/index} + system %{git clean -fdx} + + system %{git checkout gh-pages} + end + + system %{cp -Rpv #{target}/* .} + system %{git add . && git commit -a -m "Update published site"} + system %{git checkout master} + end end Attentive::CLI.start diff --git a/skel/.gitignore b/skel/.gitignore index 7b4f00c..422dd39 100644 --- a/skel/.gitignore +++ b/skel/.gitignore @@ -1,2 +1,3 @@ .sass-cache/ +.DS_Store diff --git a/views/_footer.haml b/views/_footer.haml new file mode 100644 index 0000000..e69de29