lib/nanoc/cli/commands/create-site.rb in nanoc-4.0.0b3 vs lib/nanoc/cli/commands/create-site.rb in nanoc-4.0.0b4
- old
+ new
@@ -1,10 +1,10 @@
usage 'create-site [options] path'
aliases :create_site, :cs
summary 'create a site'
-description "Create a new site at the given path. The site will use the `filesystem` data source."
-flag nil, :force, "Force creation of new site. Disregards previous existence of site in destination"
+description 'Create a new site at the given path. The site will use the `filesystem` data source.'
+flag nil, :force, 'Force creation of new site. Disregards previous existence of site in destination'
module Nanoc::CLI::Commands
class CreateSite < ::Nanoc::CLI::CommandRunner
class << self
protected
@@ -286,13 +286,13 @@
raise Nanoc::Int::Errors::GenericTrivial, "usage: #{command.usage}"
end
path = arguments[0]
# Check whether site exists
- if File.exist?(path) && (!File.directory?(path) || !(Dir.entries(path) - %w{ . .. }).empty?) && !options[:force]
+ if File.exist?(path) && (!File.directory?(path) || !(Dir.entries(path) - %w(. ..)).empty?) && !options[:force]
raise Nanoc::Int::Errors::GenericTrivial,
- "The site was not created because '#{path}' already exists. " +
- "Re-run the command using --force to create the site anyway."
+ "The site was not created because '#{path}' already exists. " \
+ 'Re-run the command using --force to create the site anyway.'
end
# Setup notifications
Nanoc::Int::NotificationCenter.on(:file_created) do |file_path|
Nanoc::CLI::Logger.instance.file(:high, :create, file_path)