# File lib/nanoc/cli/commands/create-site.rb, line 308
    def run
      # Check arguments
      if arguments.length != 1
        raise Nanoc::Errors::GenericTrivial, "usage: #{command.usage}"
      end

      # Extract arguments and options
      path        = arguments[0]
      data_source = options[:datasource] || 'filesystem_unified'

      # Check whether site exists
      if File.exist?(path)
        raise Nanoc::Errors::GenericTrivial, "A site at '#{path}' already exists."
      end

      # Check whether data source exists
      if Nanoc::DataSource.named(data_source).nil?
        raise Nanoc::Errors::GenericTrivial, "Unrecognised data source: #{data_source}"
      end

      # Setup notifications
      Nanoc::NotificationCenter.on(:file_created) do |file_path|
        Nanoc::CLI::Logger.instance.file(:high, :create, file_path)
      end

      # Build entire site
      FileUtils.mkdir_p(path)
      FileUtils.cd(File.join(path)) do
        site_create_minimal(data_source)
        site_setup
        site_populate
      end

      puts "Created a blank nanoc site at '#{path}'. Enjoy!"
    end