#!/usr/bin/env ruby
require 'dyndoc-html-servers'
if ["--no-forever","--no-daemon"].include? ARGV[0]
cfg={}
cfg[:dyn_root]=ARGV[1] if ARGV[1]
Dyndoc::HtmlServers.dyn_html_filewatcher(cfg)
else
require 'daemons'
require 'dyndoc/init/home'
require 'fileutils'
dir_pids=File.join(Dyndoc.home,"pids")
FileUtils.mkdir_p dir_pids
Daemons.run_proc('dyn-html',{dir: dir_pids}) do
Dyndoc::HtmlServers.dyn_html_filewatcher
end
end