Merge pull request #596 from bhollis/cli
Please create a "--skip-bundle" flag for middleman init
This commit is contained in:
commit
0327e2067f
|
@ -28,10 +28,18 @@ module Middleman::Cli
|
||||||
:type => :boolean,
|
:type => :boolean,
|
||||||
:default => false,
|
:default => false,
|
||||||
:desc => 'Include a config.ru file'
|
:desc => 'Include a config.ru file'
|
||||||
method_option "bundler",
|
method_option "skip-gemfile",
|
||||||
:type => :boolean,
|
:type => :boolean,
|
||||||
:default => false,
|
:default => false,
|
||||||
:desc => 'Create a Gemfile and use Bundler to manage gems'
|
:desc => "Don't create a Gemfile"
|
||||||
|
method_option "skip-bundle",
|
||||||
|
:type => :boolean,
|
||||||
|
:default => false,
|
||||||
|
:desc => "Don't run bundle install"
|
||||||
|
method_option "skip-git",
|
||||||
|
:type => :boolean,
|
||||||
|
:default => false,
|
||||||
|
:desc => 'Skip Git ignores and keeps'
|
||||||
# The init task
|
# The init task
|
||||||
# @param [String] name
|
# @param [String] name
|
||||||
def init(name)
|
def init(name)
|
||||||
|
|
|
@ -50,23 +50,28 @@ module Middleman::Templates
|
||||||
template "shared/config.ru", File.join(location, "config.ru")
|
template "shared/config.ru", File.join(location, "config.ru")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
class_option :'skip-bundle', :type => :boolean, :default => false
|
||||||
|
class_option :'skip-gemfile', :type => :boolean, :default => false
|
||||||
|
|
||||||
# Write a Bundler Gemfile file for project
|
# Write a Bundler Gemfile file for project
|
||||||
# @return [void]
|
# @return [void]
|
||||||
def generate_bundler!
|
def generate_bundler!
|
||||||
|
return if options[:'skip-gemfile']
|
||||||
template "shared/Gemfile.tt", File.join(location, "Gemfile")
|
template "shared/Gemfile.tt", File.join(location, "Gemfile")
|
||||||
|
|
||||||
|
return if options[:'skip-bundle']
|
||||||
inside(location) do
|
inside(location) do
|
||||||
::Middleman::Cli::Bundle.new.invoke(:bundle)
|
::Middleman::Cli::Bundle.new.invoke(:bundle)
|
||||||
end unless ENV["TEST"]
|
end unless ENV["TEST"]
|
||||||
end
|
end
|
||||||
|
|
||||||
# Output a .gitignore file
|
# Output a .gitignore file
|
||||||
class_option :git, :type => :boolean, :default => true
|
class_option :'skip-git', :type => :boolean, :default => false
|
||||||
|
|
||||||
# Write a .gitignore file for project
|
# Write a .gitignore file for project
|
||||||
# @return [void]
|
# @return [void]
|
||||||
def generate_gitignore!
|
def generate_gitignore!
|
||||||
return unless options[:git]
|
return if options[:'skip-git']
|
||||||
copy_file "shared/gitignore", File.join(location, ".gitignore")
|
copy_file "shared/gitignore", File.join(location, ".gitignore")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue