final mods

This commit is contained in:
ddavison 2013-08-24 21:31:05 -04:00
parent aedac6060b
commit b163bf637e
3 changed files with 7 additions and 8 deletions

View File

@ -82,7 +82,7 @@ command :serve do |c|
c.option '--limit_posts MAX_POSTS', Integer, 'Limits the number of posts to parse and publish' c.option '--limit_posts MAX_POSTS', Integer, 'Limits the number of posts to parse and publish'
c.option '-w', '--watch', 'Watch for changes and rebuild' c.option '-w', '--watch', 'Watch for changes and rebuild'
c.option '--lsi', 'Use LSI for improved related posts' c.option '--lsi', 'Use LSI for improved related posts'
c.option '-B', '--detach', 'Run this server in the background (detach)' c.option '-B', '--detach', 'Run the server in the background (detach)'
c.option '-D', '--drafts', 'Render posts in the _drafts folder' c.option '-D', '--drafts', 'Render posts in the _drafts folder'
c.option '-P', '--port [PORT]', 'Port to listen on' c.option '-P', '--port [PORT]', 'Port to listen on'

View File

@ -25,15 +25,14 @@ module Jekyll
s.mount(options['baseurl'], HTTPServlet::FileHandler, destination, fh_option) s.mount(options['baseurl'], HTTPServlet::FileHandler, destination, fh_option)
unless options['detach'] if options['detach'] # detach the server
t = Thread.new { s.start }
trap("INT") { s.shutdown }
t.join()
else
# they are detaching the server.
pid = Process.fork {s.start} pid = Process.fork {s.start}
Process.detach(pid) Process.detach(pid)
pid pid
else # create a new server thread, then join it with current terminal
t = Thread.new { s.start }
trap("INT") { s.shutdown }
t.join()
end end
end end
end end

View File

@ -15,7 +15,7 @@ module Jekyll
'timezone' => nil, # use the local timezone 'timezone' => nil, # use the local timezone
'safe' => false, 'safe' => false,
'detach' => false, # don't default to detaching the server 'detach' => false, # default to not detaching the server
'show_drafts' => nil, 'show_drafts' => nil,
'limit_posts' => 0, 'limit_posts' => 0,
'lsi' => false, 'lsi' => false,