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