wordmove 3.2.3 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a23aae8c4d2c31e8a08dc331d2ebcbf48f916e48
4
- data.tar.gz: 2d5a7f32174c44cf4456e2d8d319c7d148d04c6f
3
+ metadata.gz: 74eafcd0b3d4f911c3bc2f3513141b76aa071d5f
4
+ data.tar.gz: b98925e2826b67a0fbf94e4f3c3225d3a38ec148
5
5
  SHA512:
6
- metadata.gz: 5a0adbeaae885a0a2160201fdf838e080f1c03f7764617ee709ec340e4e90f19cebb5e48fb1080e26ed381717952e6ceddd016888a7bf086ca4a6ec7c2c7695f
7
- data.tar.gz: 07d4dbc91f6089b6ebb937cb840bcfea04845d282288ddecfdec1be2e072b0052aabe79a497a2a106d88d10db41807a0aa40e7e3e4496e7339c4d223b57bc061
6
+ metadata.gz: f61ef5c479a7cdd71d5891e6b43eb2a3d1643b3c83e3aa40a96e001f1df6a38fd099424f10207e157ebd31f699ee10ff9c89251c645e98d59e750f8e59067198
7
+ data.tar.gz: f3a8b4331b963e3d40a6f240ea62b380c8925f6b54fd3f99403e4512d5dbb5c29814feec8de5a9f044e2ae21a1e33b4749c3d669a01d1d4461da5cb09faddb47
@@ -5,4 +5,6 @@ module Wordmove
5
5
  class ShellCommandError < StandardError; end
6
6
  class ImplementInSubclassError < StandardError; end
7
7
  class UnmetPeerDependencyError < StandardError; end
8
+ class RemoteHookException < StandardError; end
9
+ class LocalHookException < StandardError; end
8
10
  end
@@ -16,14 +16,14 @@ module Wordmove
16
16
  )
17
17
 
18
18
  unless hooks.local_hooks.empty?
19
- Wordmove::Hook::Local.run(hooks.local_hooks, cli_options[:simulate])
19
+ Wordmove::Hook::Local.run(hooks.local_hooks, options[:local], cli_options[:simulate])
20
20
  end
21
21
 
22
22
  return if hooks.remote_hooks.empty?
23
23
 
24
24
  if options[environment][:ftp]
25
25
  logger.debug "You have configured remote hooks to run over "\
26
- "an FTP connections, but this is not possible. Skipping."
26
+ "an FTP connection, but this is not possible. Skipping."
27
27
 
28
28
  return
29
29
  end
@@ -66,20 +66,23 @@ module Wordmove
66
66
  parent.logger
67
67
  end
68
68
 
69
- def self.run(commands, simulate = false)
69
+ def self.run(commands, options, simulate = false)
70
70
  logger.task "Running local hooks"
71
71
 
72
+ wordpress_path = options[:wordpress_path]
73
+
72
74
  commands.each do |command|
73
75
  logger.task_step true, "Exec command: #{command}"
74
76
  return true if simulate
75
77
 
76
- stdout_return = `#{command} 2>&1`
78
+ stdout_return = `cd #{wordpress_path} && #{command} 2>&1`
77
79
  logger.task_step true, "Output: #{stdout_return}"
78
80
 
79
81
  if $CHILD_STATUS.exitstatus.zero?
80
82
  logger.success ""
81
83
  else
82
84
  logger.error "Error code: #{$CHILD_STATUS.exitstatus}"
85
+ raise Wordmove::LocalHookException
83
86
  end
84
87
  end
85
88
  end
@@ -110,6 +113,7 @@ module Wordmove
110
113
  else
111
114
  logger.task_step false, "Output: #{stderr}"
112
115
  logger.error "Error code #{exit_code}"
116
+ raise Wordmove::RemoteHookException
113
117
  end
114
118
  end
115
119
  end
@@ -1,3 +1,3 @@
1
1
  module Wordmove
2
- VERSION = "3.2.3".freeze
2
+ VERSION = "4.0.0".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: 3.2.3
4
+ version: 4.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefano Verna
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: exe
14
14
  cert_chain: []
15
- date: 2019-01-04 00:00:00.000000000 Z
15
+ date: 2019-01-06 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: activesupport
@@ -313,7 +313,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
313
313
  version: '0'
314
314
  requirements: []
315
315
  rubyforge_project:
316
- rubygems_version: 2.6.14
316
+ rubygems_version: 2.6.11
317
317
  signing_key:
318
318
  specification_version: 4
319
319
  summary: Wordmove, Capistrano for Wordpress