Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
brew
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to JiHu GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
KMSCAKKSCFKA AKFACAMADCAS
brew
Commits
cb28ab64
Commit
cb28ab64
authored
7 years ago
by
Joshua McKinney
Browse files
Options
Downloads
Patches
Plain Diff
Refactor uninstall existing cask
parent
a90d1e16
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Library/Homebrew/cask/lib/hbc/installer.rb
+5
-7
5 additions, 7 deletions
Library/Homebrew/cask/lib/hbc/installer.rb
with
5 additions
and
7 deletions
Library/Homebrew/cask/lib/hbc/installer.rb
+
5
−
7
View file @
cb28ab64
...
...
@@ -84,7 +84,7 @@ module Hbc
print_caveats
fetch
uninstall_
if_neccessary
uninstall_
existing_cask
if
@reinstall
oh1
"Installing Cask
#{
@cask
}
"
stage
...
...
@@ -100,14 +100,12 @@ module Hbc
install
end
def
uninstall_if_neccessary
return
unless
@cask
.
installed?
&&
@reinstall
installed_cask
=
@cask
def
uninstall_existing_cask
return
unless
@cask
.
installed?
# use the same cask file that was used for installation, if possible
if
(
installed_caskfile
=
installed_cask
.
installed_caskfile
).
exist?
installed_cask
=
CaskLoader
.
load_from_file
(
installed_caskfile
)
end
installed_caskfile
=
@cask
.
installed_caskfile
installed_cask
=
installed_caskfile
.
exist?
?
CaskLoader
.
load_from_file
(
installed_caskfile
)
:
@cask
# Always force uninstallation, ignore method parameter
Installer
.
new
(
installed_cask
,
force:
true
).
uninstall
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment