Sha256: 3360b0acaefd1e74c81871890b4f0068fa66d40f7e7b50d7e9e42f5007619582

Contents?: true

Size: 830 Bytes

Versions: 4

Compression:

Stored size: 830 Bytes

Contents

module WordPressTools
  class CLI < Thor
    include CLIHelper
    include SharedOptions

    desc "new [DIR_NAME]", "download the latest stable version of WordPress in a new directory with specified name (default is wordpress)"
    add_method_options(shared_options)
    def new(dir_name = 'wordpress')
      if File.exist?(dir_name)
        say "Directory #{dir_name} already exists.", :red
        exit
      end

      info("Starting...")

      WPCLICore.new.invoke :install, [], options
      WPCLIServer.new.invoke :install, [], options
      Database.new.invoke :create, [dir_name], options
      WordPress.new.invoke :download, [dir_name], options
      WordPress.new.invoke :setup, [dir_name], options

      success("All done. Run 'wp server' inside '#{dir_name}' and visit '#{options[:site_url]}'")
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
wordpress_tools-1.1.3 lib/wordpress_tools/cli.rb
wordpress_tools-1.1.2 lib/wordpress_tools/cli.rb
wordpress_tools-1.1.1 lib/wordpress_tools/cli.rb
wordpress_tools-1.1.0 lib/wordpress_tools/cli.rb