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
7f6ef77d
Commit
7f6ef77d
authored
5 years ago
by
Doug Hogan
Browse files
Options
Downloads
Patches
Plain Diff
Address PR comments: remove test and use return ... if
parent
ac0ff9ae
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Library/Homebrew/cask/cmd/upgrade.rb
+8
-10
8 additions, 10 deletions
Library/Homebrew/cask/cmd/upgrade.rb
Library/Homebrew/cmd/upgrade.rb
+5
-7
5 additions, 7 deletions
Library/Homebrew/cmd/upgrade.rb
Library/Homebrew/test/cmd/upgrade_spec.rb
+0
-13
0 additions, 13 deletions
Library/Homebrew/test/cmd/upgrade_spec.rb
with
13 additions
and
30 deletions
Library/Homebrew/cask/cmd/upgrade.rb
+
8
−
10
View file @
7f6ef77d
...
...
@@ -42,16 +42,14 @@ module Cask
.
map
{
|
(
old_cask
,
new_cask
)
|
"
#{
new_cask
.
full_name
}
#{
old_cask
.
version
}
->
#{
new_cask
.
version
}
"
}
.
join
(
", "
)
if
dry_run?
puts
"Dry run: did not upgrade anything."
else
upgradable_casks
.
each
do
|
(
old_cask
,
new_cask
)
|
begin
upgrade_cask
(
old_cask
,
new_cask
)
rescue
CaskError
=>
e
caught_exceptions
<<
e
next
end
return
puts
"Dry run: did not upgrade anything."
if
dry_run?
upgradable_casks
.
each
do
|
(
old_cask
,
new_cask
)
|
begin
upgrade_cask
(
old_cask
,
new_cask
)
rescue
CaskError
=>
e
caught_exceptions
<<
e
next
end
end
...
...
This diff is collapsed.
Click to expand it.
Library/Homebrew/cmd/upgrade.rb
+
5
−
7
View file @
7f6ef77d
...
...
@@ -106,15 +106,13 @@ module Homebrew
puts
formulae_upgrades
.
join
(
", "
)
end
if
args
.
dry_run?
puts
"Dry run: did not upgrade anything."
else
upgrade_formulae
(
formulae_to_install
)
return
puts
"Dry run: did not upgrade anything."
if
args
.
dry_run?
check_dependents
(
formulae_to_install
)
upgrade_formulae
(
formulae_to_install
)
Homebrew
.
messages
.
display_messages
end
check_dependents
(
formulae_to_install
)
Homebrew
.
messages
.
display_messages
end
def
upgrade_formulae
(
formulae_to_install
)
...
...
This diff is collapsed.
Click to expand it.
Library/Homebrew/test/cmd/upgrade_spec.rb
+
0
−
13
View file @
7f6ef77d
...
...
@@ -16,17 +16,4 @@ describe "brew upgrade", :integration_test do
expect
(
HOMEBREW_CELLAR
/
"testball/0.1"
).
to
be_a_directory
expect
(
HOMEBREW_CELLAR
/
"testball/0.0.1"
).
not_to
exist
end
it
"can do a dry run upgrade"
do
setup_test_formula
"testball"
(
HOMEBREW_CELLAR
/
"testball/0.0.1/foo"
).
mkpath
expect
{
brew
"upgrade"
,
"--dry-run"
}
.
to
output
(
/Dry run: did not upgrade anything/
).
to_stdout
.
and
not_to_output
.
to_stderr
.
and
be_a_success
expect
(
HOMEBREW_CELLAR
/
"testball/0.1"
).
not_to
exist
expect
(
HOMEBREW_CELLAR
/
"testball/0.0.1"
).
to
be_a_directory
end
end
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