Sha256: e328617beea35c2f3f8ec5af005b15719c3688cbca039d12d635bc44f14c4757

Contents?: true

Size: 549 Bytes

Versions: 15

Compression:

Stored size: 549 Bytes

Contents

module Wordmove
  module SqlAdapter
    class Wpcli
      attr_accessor :sql_content
      attr_reader :from, :to

      def initialize(source_config, dest_config, config_key)
        @from = source_config[config_key]
        @to = dest_config[config_key]
      end

      def command
        unless system('which wp > /dev/null 2>&1')
          raise UnmetPeerDependencyError, "WP-CLI is not installed or not in your $PATH"
        end

        "wp search-replace #{from} #{to} --quiet --skip-columns=guid --all-tables"
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
wordmove-2.5.0 lib/wordmove/sql_adapter/wpcli.rb
wordmove-2.4.4 lib/wordmove/sql_adapter/wpcli.rb
wordmove-2.4.3 lib/wordmove/sql_adapter/wpcli.rb
wordmove-2.4.2 lib/wordmove/sql_adapter/wpcli.rb
wordmove-2.4.1 lib/wordmove/sql_adapter/wpcli.rb
wordmove-2.4.0 lib/wordmove/sql_adapter/wpcli.rb
wordmove-2.3.1 lib/wordmove/sql_adapter/wpcli.rb
wordmove-2.3.0 lib/wordmove/sql_adapter/wpcli.rb
wordmove-2.2.1 lib/wordmove/sql_adapter/wpcli.rb
wordmove-2.2.0 lib/wordmove/sql_adapter/wpcli.rb
wordmove-2.1.4 lib/wordmove/sql_adapter/wpcli.rb
wordmove-2.1.3 lib/wordmove/sql_adapter/wpcli.rb
wordmove-2.1.2 lib/wordmove/sql_adapter/wpcli.rb
wordmove-2.1.1 lib/wordmove/sql_adapter/wpcli.rb
wordmove-2.1.0 lib/wordmove/sql_adapter/wpcli.rb