Permalink
Browse files

Makes rake github a little smarter.

  • Loading branch information...
1 parent 8c657f7 commit 37f62626f4f2dd3de5e9bd7234ba5ad88245066f @icco committed Jul 20, 2011
Showing with 6 additions and 8 deletions.
  1. +6 −8 Rakefile
View
@@ -42,7 +42,7 @@ task :heroku do
puts '--> Heroku Push successful.'
end
-# TODO: Make this dynamically figure out all of the files needed
+# TODO: Make this dynamically figure out all of the files needed from Sinatra.
desc "Deploy to remote defined in config.yaml"
task :github do
require File.expand_path('../resume',__FILE__)
@@ -63,14 +63,12 @@ task :github do
browser = Rack::Test::Session.new(Rack::MockSession.new(Sinatra::Application))
files = [
- '/index.html',
- '/print.less',
- '/style.less',
- '/resume.txt',
- '/less-1.1.3.min.js',
- '/favicon.ico'
+ 'index.html',
+ 'resume.txt',
]
+ files = files + Dir.entries("public").keep_if {|file| File.file? "public/#{file}"}
+
root = "/tmp/checkout-#{Time.now.to_i}"
g = Git.clone(remote, root, :log => Logger.new(STDOUT))
@@ -80,7 +78,7 @@ task :github do
files.each {|file|
browser.get file
content = browser.last_response.body
- File.open("#{root}#{file}", 'w') {|f| f.write(content) }
+ File.open("#{root}/#{file}", 'w') {|f| f.write(content) }
g.add(File.basename(file))
}

0 comments on commit 37f6262

Please sign in to comment.