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
55ef924e
Commit
55ef924e
authored
8 years ago
by
Raymond Wanyoike
Browse files
Options
Downloads
Patches
Plain Diff
cask reinstall: download and verify cask before uninstall
Closes: caskroom/homebrew-cask#27075
parent
697340ff
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/cli/reinstall.rb
+30
-4
30 additions, 4 deletions
Library/Homebrew/cask/lib/hbc/cli/reinstall.rb
with
30 additions
and
4 deletions
Library/Homebrew/cask/lib/hbc/cli/reinstall.rb
+
30
−
4
View file @
55ef924e
...
...
@@ -7,6 +7,24 @@ module Hbc
begin
cask
=
Hbc
.
load
(
cask_token
)
installer
=
Installer
.
new
(
cask
,
force:
force
,
skip_cask_deps:
skip_cask_deps
,
require_sha:
require_sha
)
installer
.
print_caveats
# Download
begin
installer
.
satisfy_dependencies
installer
.
verify_has_sha
if
@require_sha
&&
!
@force
installer
.
download
installer
.
verify
rescue
StandardError
=>
e
installer
.
purge_versioned_files
raise
e
end
# Uninstall
if
cask
.
installed?
# use copy of cask for uninstallation to avoid 'No such file or directory' bug
installed_cask
=
cask
...
...
@@ -26,10 +44,18 @@ module Hbc
Installer
.
new
(
installed_cask
,
force:
true
).
uninstall
end
Installer
.
new
(
cask
,
force:
force
,
skip_cask_deps:
skip_cask_deps
,
require_sha:
require_sha
).
install
# Reinstall
begin
installer
.
extract_primary_container
installer
.
install_artifacts
installer
.
save_caskfile
installer
.
enable_accessibility_access
rescue
StandardError
=>
e
installer
.
purge_versioned_files
raise
e
end
puts
installer
.
summary
count
+=
1
rescue
CaskUnavailableError
=>
e
warn_unavailable_with_suggestion
cask_token
,
e
...
...
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