Merge pull request #5017 from DirtyF/rubocop-exe
Merge pull request 5017
This commit is contained in:
commit
8fd287edba
|
@ -4,7 +4,6 @@ AllCops:
|
||||||
Include:
|
Include:
|
||||||
- lib/**/*.rb
|
- lib/**/*.rb
|
||||||
Exclude:
|
Exclude:
|
||||||
- exe/jekyll
|
|
||||||
- lib/jekyll/collection.rb
|
- lib/jekyll/collection.rb
|
||||||
- lib/jekyll/command.rb
|
- lib/jekyll/command.rb
|
||||||
- lib/jekyll/configuration.rb
|
- lib/jekyll/configuration.rb
|
||||||
|
|
30
exe/jekyll
30
exe/jekyll
|
@ -1,10 +1,10 @@
|
||||||
#!/usr/bin/env ruby
|
#!/usr/bin/env ruby
|
||||||
STDOUT.sync = true
|
STDOUT.sync = true
|
||||||
|
|
||||||
$LOAD_PATH.unshift File.join(File.dirname(__FILE__), *%w( .. lib ))
|
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), *%w( .. lib )))
|
||||||
|
|
||||||
require 'jekyll'
|
require "jekyll"
|
||||||
require 'mercenary'
|
require "mercenary"
|
||||||
|
|
||||||
Jekyll::PluginManager.require_from_bundler
|
Jekyll::PluginManager.require_from_bundler
|
||||||
|
|
||||||
|
@ -12,22 +12,26 @@ Jekyll::Deprecator.process(ARGV)
|
||||||
|
|
||||||
Mercenary.program(:jekyll) do |p|
|
Mercenary.program(:jekyll) do |p|
|
||||||
p.version Jekyll::VERSION
|
p.version Jekyll::VERSION
|
||||||
p.description 'Jekyll is a blog-aware, static site generator in Ruby'
|
p.description "Jekyll is a blog-aware, static site generator in Ruby"
|
||||||
p.syntax 'jekyll <subcommand> [options]'
|
p.syntax "jekyll <subcommand> [options]"
|
||||||
|
|
||||||
p.option 'source', '-s', '--source [DIR]', 'Source directory (defaults to ./)'
|
p.option "source", "-s", "--source [DIR]", "Source directory (defaults to ./)"
|
||||||
p.option 'destination', '-d', '--destination [DIR]', 'Destination directory (defaults to ./_site)'
|
p.option "destination", "-d", "--destination [DIR]",
|
||||||
p.option 'safe', '--safe', 'Safe mode (defaults to false)'
|
"Destination directory (defaults to ./_site)"
|
||||||
p.option 'plugins_dir', '-p', '--plugins PLUGINS_DIR1[,PLUGINS_DIR2[,...]]', Array, 'Plugins directory (defaults to ./_plugins)'
|
p.option "safe", "--safe", "Safe mode (defaults to false)"
|
||||||
p.option 'layouts_dir', '--layouts DIR', String, 'Layouts directory (defaults to ./_layouts)'
|
p.option "plugins_dir", "-p", "--plugins PLUGINS_DIR1[,PLUGINS_DIR2[,...]]", Array,
|
||||||
p.option 'profile', '--profile', 'Generate a Liquid rendering profile'
|
"Plugins directory (defaults to ./_plugins)"
|
||||||
|
p.option "layouts_dir", "--layouts DIR", String,
|
||||||
|
"Layouts directory (defaults to ./_layouts)"
|
||||||
|
p.option "profile", "--profile", "Generate a Liquid rendering profile"
|
||||||
|
|
||||||
Jekyll::External.require_if_present(Jekyll::External.blessed_gems) do |g|
|
Jekyll::External.require_if_present(Jekyll::External.blessed_gems) do |g|
|
||||||
cmd = g.split('-').last
|
cmd = g.split("-").last
|
||||||
p.command(cmd.to_sym) do |c|
|
p.command(cmd.to_sym) do |c|
|
||||||
c.syntax cmd
|
c.syntax cmd
|
||||||
c.action do
|
c.action do
|
||||||
Jekyll.logger.abort_with "You must install the '#{g}' gem to use the 'jekyll #{cmd}' command."
|
Jekyll.logger.abort_with "You must install the '#{g}' gem" \
|
||||||
|
" to use the 'jekyll #{cmd}' command."
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue