Show messages when (un)installing Casks
Addresses an issue where it can be unclear at times exactly which part of the (un|re)installation processes is reporting an error. See https://github.com/caskroom/homebrew-cask/issues/30968
This commit is contained in:
parent
367fdb9718
commit
3703ef1885
@ -85,6 +85,8 @@ module Hbc
|
|||||||
print_caveats
|
print_caveats
|
||||||
fetch
|
fetch
|
||||||
uninstall_if_neccessary
|
uninstall_if_neccessary
|
||||||
|
|
||||||
|
oh1 "Installing Cask #{@cask}"
|
||||||
stage
|
stage
|
||||||
install_artifacts
|
install_artifacts
|
||||||
enable_accessibility_access
|
enable_accessibility_access
|
||||||
@ -322,7 +324,7 @@ module Hbc
|
|||||||
end
|
end
|
||||||
|
|
||||||
def uninstall
|
def uninstall
|
||||||
odebug "Hbc::Installer#uninstall"
|
oh1 "Uninstalling Cask #{@cask}"
|
||||||
disable_accessibility_access
|
disable_accessibility_access
|
||||||
uninstall_artifacts
|
uninstall_artifacts
|
||||||
purge_versioned_files
|
purge_versioned_files
|
||||||
|
|||||||
@ -1,4 +1,18 @@
|
|||||||
describe Hbc::CLI::Install, :cask do
|
describe Hbc::CLI::Install, :cask do
|
||||||
|
it "displays the installation progress" do
|
||||||
|
output = Regexp.new <<-EOS.undent
|
||||||
|
==> Downloading file:.*/caffeine.zip
|
||||||
|
==> Verifying checksum for Cask local-caffeine
|
||||||
|
==> Installing Cask local-caffeine
|
||||||
|
==> Moving App 'Caffeine.app' to '.*/Caffeine.app'.
|
||||||
|
🍺 local-caffeine was successfully installed!
|
||||||
|
EOS
|
||||||
|
|
||||||
|
expect {
|
||||||
|
Hbc::CLI::Install.run("local-caffeine")
|
||||||
|
}.to output(output).to_stdout
|
||||||
|
end
|
||||||
|
|
||||||
it "allows staging and activation of multiple Casks at once" do
|
it "allows staging and activation of multiple Casks at once" do
|
||||||
shutup do
|
shutup do
|
||||||
Hbc::CLI::Install.run("local-transmission", "local-caffeine")
|
Hbc::CLI::Install.run("local-transmission", "local-caffeine")
|
||||||
|
|||||||
@ -1,4 +1,27 @@
|
|||||||
describe Hbc::CLI::Reinstall, :cask do
|
describe Hbc::CLI::Reinstall, :cask do
|
||||||
|
it "displays the reinstallation progress" do
|
||||||
|
caffeine = Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/local-caffeine.rb")
|
||||||
|
|
||||||
|
shutup do
|
||||||
|
Hbc::Installer.new(caffeine).install
|
||||||
|
end
|
||||||
|
|
||||||
|
output = Regexp.new <<-EOS.undent
|
||||||
|
==> Downloading file:.*/caffeine.zip
|
||||||
|
Already downloaded: .*/local-caffeine--1.2.3.zip
|
||||||
|
==> Verifying checksum for Cask local-caffeine
|
||||||
|
==> Uninstalling Cask local-caffeine
|
||||||
|
==> Removing App '.*/Caffeine.app'.
|
||||||
|
==> Installing Cask local-caffeine
|
||||||
|
==> Moving App 'Caffeine.app' to '.*/Caffeine.app'.
|
||||||
|
🍺 local-caffeine was successfully installed!
|
||||||
|
EOS
|
||||||
|
|
||||||
|
expect {
|
||||||
|
Hbc::CLI::Reinstall.run("local-caffeine")
|
||||||
|
}.to output(output).to_stdout
|
||||||
|
end
|
||||||
|
|
||||||
it "allows reinstalling a Cask" do
|
it "allows reinstalling a Cask" do
|
||||||
shutup do
|
shutup do
|
||||||
Hbc::CLI::Install.run("local-transmission")
|
Hbc::CLI::Install.run("local-transmission")
|
||||||
|
|||||||
@ -1,4 +1,21 @@
|
|||||||
describe Hbc::CLI::Uninstall, :cask do
|
describe Hbc::CLI::Uninstall, :cask do
|
||||||
|
it "displays the uninstallation progress" do
|
||||||
|
caffeine = Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/local-caffeine.rb")
|
||||||
|
|
||||||
|
shutup do
|
||||||
|
Hbc::Installer.new(caffeine).install
|
||||||
|
end
|
||||||
|
|
||||||
|
output = Regexp.new <<-EOS.undent
|
||||||
|
==> Uninstalling Cask local-caffeine
|
||||||
|
==> Removing App '.*/Caffeine.app'.
|
||||||
|
EOS
|
||||||
|
|
||||||
|
expect {
|
||||||
|
Hbc::CLI::Uninstall.run("local-caffeine")
|
||||||
|
}.to output(output).to_stdout
|
||||||
|
end
|
||||||
|
|
||||||
it "shows an error when a bad Cask is provided" do
|
it "shows an error when a bad Cask is provided" do
|
||||||
expect {
|
expect {
|
||||||
Hbc::CLI::Uninstall.run("notacask")
|
Hbc::CLI::Uninstall.run("notacask")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user