final mods
This commit is contained in:
parent
aedac6060b
commit
b163bf637e
|
@ -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 '-w', '--watch', 'Watch for changes and rebuild'
|
||||
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 '-P', '--port [PORT]', 'Port to listen on'
|
||||
|
|
|
@ -25,15 +25,14 @@ module Jekyll
|
|||
|
||||
s.mount(options['baseurl'], HTTPServlet::FileHandler, destination, fh_option)
|
||||
|
||||
unless options['detach']
|
||||
t = Thread.new { s.start }
|
||||
trap("INT") { s.shutdown }
|
||||
t.join()
|
||||
else
|
||||
# they are detaching the server.
|
||||
if options['detach'] # detach the server
|
||||
pid = Process.fork {s.start}
|
||||
Process.detach(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
|
||||
|
|
|
@ -15,7 +15,7 @@ module Jekyll
|
|||
'timezone' => nil, # use the local timezone
|
||||
|
||||
'safe' => false,
|
||||
'detach' => false, # don't default to detaching the server
|
||||
'detach' => false, # default to not detaching the server
|
||||
'show_drafts' => nil,
|
||||
'limit_posts' => 0,
|
||||
'lsi' => false,
|
||||
|
|
Loading…
Reference in New Issue