Merge pull request #3515 from rolandwalker/unload_service
explicitly unload :launchctl service before remove
This commit is contained in:
commit
be255dcdbc
|
@ -104,6 +104,8 @@ class Cask::Artifact::Pkg < Cask::Artifact::Base
|
|||
[false, true].each do |with_sudo|
|
||||
xml_status = @command.run('/bin/launchctl', :args => ['list', '-x', service], :sudo => with_sudo)
|
||||
if %r{^<\?xml}.match(xml_status)
|
||||
@command.run('/bin/launchctl', :args => ['unload', '-w', '--', service], :sudo => with_sudo)
|
||||
sleep 1
|
||||
@command.run!('/bin/launchctl', :args => ['remove', '--', service], :sudo => with_sudo)
|
||||
sleep 1
|
||||
end
|
||||
|
|
|
@ -108,6 +108,7 @@ describe Cask::Artifact::Pkg do
|
|||
)
|
||||
|
||||
Cask::FakeSystemCommand.expects_command(['/usr/bin/sudo', '-E', '--', '/bin/launchctl', 'remove', '--', 'my.fancy.package.service'])
|
||||
Cask::FakeSystemCommand.expects_command(['/usr/bin/sudo', '-E', '--', '/bin/launchctl', 'unload', '-w', '--', 'my.fancy.package.service'])
|
||||
|
||||
Cask::FakeSystemCommand.stubs_command(['/usr/bin/sudo', '-E', '--', '/usr/sbin/kextstat', '-l', '-b', 'my.fancy.package.kernelextension'], 'loaded')
|
||||
Cask::FakeSystemCommand.expects_command(['/usr/bin/sudo', '-E', '--', '/sbin/kextunload', '-b', '--', 'my.fancy.package.kernelextension'])
|
||||
|
|
Loading…
Reference in New Issue