Auto-enable watch on 'serve'.

Addresses @kneath's and @chibicode's comments in #2695.
This commit is contained in:
Parker Moore 2014-08-30 16:18:29 -07:00
parent 7de681ef58
commit 6cee2a87cc
4 changed files with 5 additions and 4 deletions

View File

@ -146,7 +146,7 @@ namespace :site do
# Generate the site in server mode.
puts "Running Jekyll..."
Dir.chdir("site") do
sh "#{File.expand_path('bin/jekyll', File.dirname(__FILE__))} serve --watch"
sh "#{File.expand_path('bin/jekyll', File.dirname(__FILE__))} serve"
end
end

View File

@ -51,7 +51,7 @@ module Jekyll
c.option 'config', '--config CONFIG_FILE[,CONFIG_FILE2,...]', Array, 'Custom configuration file'
c.option 'future', '--future', 'Publishes posts with a future date'
c.option 'limit_posts', '--limit_posts MAX_POSTS', Integer, 'Limits the number of posts to parse and publish'
c.option 'watch', '-w', '--watch', 'Watch for changes and rebuild'
c.option 'watch', '-w', '--[no-]watch', 'Watch for changes and rebuild'
c.option 'force_polling', '--force_polling', 'Force watch to use polling'
c.option 'lsi', '--lsi', 'Use LSI for improved related posts'
c.option 'show_drafts', '-D', '--drafts', 'Render posts in the _drafts folder'

View File

@ -20,7 +20,8 @@ module Jekyll
c.option 'skip_initial_build', '--skip-initial-build', 'Skips the initial site build which occurs before the server is started.'
c.action do |args, options|
options["serving"] ||= true
options["serving"] = true
options["watch"] = true unless options.key?("watch")
Jekyll::Commands::Build.process(options)
Jekyll::Commands::Serve.process(options)
end

View File

@ -211,7 +211,7 @@ module Jekyll
if config.key?('auto') || config.key?('watch')
Jekyll.logger.warn "Deprecation:", "Auto-regeneration can no longer" +
" be set from your configuration file(s). Use the"+
" --watch/-w command-line option instead."
" --[no-]watch/-w command-line option instead."
config.delete('auto')
config.delete('watch')
end