wordmove 1.4.0.pre9 → 1.4.0.pre10

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9caa9bc5f31cab7cdbce7a1580c07205be36ed96
4
- data.tar.gz: 69233c6089ba0cf3763d3c5d003eb0efb1a00801
3
+ metadata.gz: 781f0aa3bebc3b78dd3e36efa9e049027fcaec32
4
+ data.tar.gz: f91ee9fb6ab4e11224b763aaf413e8fbfc054fb9
5
5
  SHA512:
6
- metadata.gz: dccc856462a7d1e8167c3a9ee0fbd055f9d617abce226512f072720f5bc8ffafd3e801c85126803998284d0b45cbabd3fd4557f6dae316c897ea83f760e54b57
7
- data.tar.gz: f2eea7b65738f73904d545cddae17d3695cc5556496300d1db234216c1ef0b84b5eb89eed6b22841fd82233d75065d4a020706e32d4fead35dc25d4775e25499
6
+ metadata.gz: ec771f5a51e0d4ca7f168953b6be7389083b27953f36ff431272666487c85c262c043fd8f961fc8da8822cfd5c06f328b7f3f14784e61b063712332a59fe6ee9
7
+ data.tar.gz: 503596d3476878e32374edc55364369447a5458541f4f9f7517f664d83922079bf94c6cc69073706593c8c810c74eb80ef65b7bebc62a7548b3b8ba920064e7c
@@ -25,6 +25,7 @@ module Wordmove
25
25
  simulate: { aliases: "-s", type: :boolean },
26
26
  environment: { aliases: "-e" },
27
27
  config: { aliases: "-c" },
28
+ debug: { type: :boolean },
28
29
 
29
30
  no_adapt: { type: :boolean },
30
31
  all: { type: :boolean }
@@ -44,7 +44,11 @@ module Wordmove
44
44
  run mysql_import_command(local_dump_path, local_options[:database])
45
45
 
46
46
  # and locally
47
- run rm_command(local_dump_path)
47
+ if options[:debug]
48
+ logger.debug "Remote dump located at: #{local_dump_path}"
49
+ else
50
+ run rm_command(local_dump_path)
51
+ end
48
52
  end
49
53
 
50
54
  private
@@ -99,7 +103,7 @@ module Wordmove
99
103
  end
100
104
 
101
105
  def import_remote_dump
102
- temp_path = local_wp_content_dir.path("temp.txt")
106
+ temp_path = local_wp_content_dir.path("log.html")
103
107
  remote_import_script_path = remote_wp_content_dir.path("import.php")
104
108
  # generate a secure one-time password
105
109
  one_time_password = SecureRandom.hex(40)
@@ -114,7 +118,11 @@ module Wordmove
114
118
  "&start=1&foffset=0&totalqueries=0&fn=dump.sql"
115
119
  ].join
116
120
  download(import_url, temp_path)
117
- run rm_command(temp_path)
121
+ if options[:debug]
122
+ logger.debug "Operation log located at: #{temp_path}"
123
+ else
124
+ run rm_command(temp_path)
125
+ end
118
126
  # remove script remotely
119
127
  remote_delete(remote_import_script_path)
120
128
  end
@@ -18,8 +18,12 @@ module Wordmove
18
18
  end
19
19
  end
20
20
 
21
- def error(msg)
22
- puts "ERROR: ".red + msg.black
21
+ def error(message)
22
+ puts " error".red + " | ".black + message
23
+ end
24
+
25
+ def debug(message)
26
+ puts " debug".magenta + " | ".black + message
23
27
  end
24
28
 
25
29
  private
@@ -1,3 +1,3 @@
1
1
  module Wordmove
2
- VERSION = "1.4.0.pre9".freeze
2
+ VERSION = "1.4.0.pre10".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wordmove
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0.pre9
4
+ version: 1.4.0.pre10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefano Verna