Skip to content
Snippets Groups Projects
Commit fcd88b71 authored by Markus Reiter's avatar Markus Reiter
Browse files

Allow skipping `uninstall script:` when `--force` is passed.

parent f4965685
No related branches found
No related tags found
No related merge requests found
...@@ -201,7 +201,15 @@ module Hbc ...@@ -201,7 +201,15 @@ module Hbc
ohai "Running uninstall script #{executable}" ohai "Running uninstall script #{executable}"
raise CaskInvalidError.new(@cask, "#{stanza} :#{directive_name} without :executable.") if executable.nil? raise CaskInvalidError.new(@cask, "#{stanza} :#{directive_name} without :executable.") if executable.nil?
executable_path = @cask.staged_path.join(executable) executable_path = @cask.staged_path.join(executable)
@command.run("/bin/chmod", args: ["--", "+x", executable_path]) if File.exist?(executable_path)
unless executable_path.exist?
message = "uninstall script #{executable} does not exist"
raise CaskError, "#{message}." unless force
opoo "#{message}, skipping."
return
end
@command.run("/bin/chmod", args: ["--", "+x", executable_path])
@command.run(executable_path, script_arguments) @command.run(executable_path, script_arguments)
sleep 1 sleep 1
end end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment