Skip to content

Commit

Permalink
Blogs are generated when sinatra starts. This is to fix the issue of …
Browse files Browse the repository at this point in the history
…added files missing when the server restarts on heroku
  • Loading branch information
Austen Ito committed Apr 22, 2012
1 parent e914412 commit 37a102a
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions server.rb
Expand Up @@ -4,9 +4,7 @@
$root = ::File.dirname(__FILE__)

post /##git_post_receive_url##/ do
system 'git init'
system 'git pull upstream master'
system 'rake generate'
generate
end

get(/.+/) do
Expand All @@ -23,3 +21,11 @@ def send_sinatra_file(path, &missing_file_block)
File.exist?(file_path) ? send_file(file_path) : missing_file_block.call
end

def generate
system 'git pull upstream master'
system 'rake generate'
end

configure do
generate
end

0 comments on commit 37a102a

Please sign in to comment.