Sha256: e73a2ccd98c2147ad514236ff60aa52eb4d29e279a8913bd8c9bfc53954f88bf

Contents?: true

Size: 779 Bytes

Versions: 2

Compression:

Stored size: 779 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
      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

2 entries across 2 versions & 1 rubygems

Version Path
wordpress_tools-1.3.0 lib/wordpress_tools/cli.rb
wordpress_tools-1.2.0 lib/wordpress_tools/cli.rb