"middleman init" will create a project in the current directory. Fixes #1181.

This commit is contained in:
Ben Hollis 2014-02-19 23:13:59 -08:00
parent 3995ad850c
commit ca50f21fac
2 changed files with 19 additions and 9 deletions

View file

@ -16,6 +16,16 @@ Feature: Middleman CLI
| source/stylesheets/all.css |
| source/stylesheets/normalize.css |
Scenario: Create a new project in the current directory
Given a directory named "MY_PROJECT"
When I cd to "MY_PROJECT"
And I run `middleman init`
Then the exit status should be 0
And the following files should exist:
| Gemfile |
| config.rb |
| source/index.html.erb |
Scenario: Create a new project (alias i)
When I run `middleman i MY_PROJECT`
Then a directory named "MY_PROJECT" should exist

View file

@ -43,7 +43,7 @@ module Middleman::Cli
:desc => 'Skip Git ignores and keeps'
# The init task
# @param [String] name
def init(name)
def init(name = '.')
key = options[:template].to_sym
unless ::Middleman::Templates.registered.has_key?(key)
raise Thor::Error.new "Unknown project template '#{key}'"