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
b48d095a
Unverified
Commit
b48d095a
authored
4 years ago
by
Michka Popoff
Committed by
GitHub
4 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #8175 from Rylan12/outdated-fix-args
outdated: fix args
parents
bfaff0af
49678e58
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/cmd/outdated.rb
+20
-20
20 additions, 20 deletions
Library/Homebrew/cmd/outdated.rb
with
20 additions
and
20 deletions
Library/Homebrew/cmd/outdated.rb
+
20
−
20
View file @
b48d095a
...
...
@@ -50,20 +50,20 @@ module Homebrew
# odeprecated "brew outdated --json#{json_version == :v1 ? "=v1" : ""}", "brew outdated --json=v2"
outdated
=
if
args
.
formula?
||
!
args
.
cask?
outdated_formulae
outdated_formulae
args:
args
else
outdated_casks
outdated_casks
args:
args
end
puts
JSON
.
generate
(
json_info
(
outdated
,
args:
args
))
when
:v2
formulae
,
casks
=
if
args
.
formula?
[
outdated_formulae
,
[]]
[
outdated_formulae
(
args:
args
)
,
[]]
elsif
args
.
cask?
[[],
outdated_casks
]
[[],
outdated_casks
(
args:
args
)
]
else
outdated_formulae_casks
outdated_formulae_casks
args:
args
end
json
=
{
...
...
@@ -76,11 +76,11 @@ module Homebrew
else
outdated
=
if
args
.
formula?
outdated_formulae
outdated_formulae
args:
args
elsif
args
.
cask?
outdated_casks
outdated_casks
args:
args
else
outdated_formulae_casks
.
flatten
outdated_formulae_casks
(
args:
args
)
.
flatten
end
print_outdated
(
outdated
,
args:
args
)
...
...
@@ -94,7 +94,7 @@ module Homebrew
if
formula_or_cask
.
is_a?
(
Formula
)
f
=
formula_or_cask
if
verbose?
if
verbose?
args:
args
outdated_kegs
=
f
.
outdated_kegs
(
fetch_head:
args
.
fetch_HEAD?
)
current_version
=
if
f
.
alias_changed?
...
...
@@ -122,7 +122,7 @@ module Homebrew
else
c
=
formula_or_cask
puts
c
.
outdated_info
(
args
.
greedy?
,
verbose?
,
false
)
puts
c
.
outdated_info
(
args
.
greedy?
,
verbose?
(
args:
args
)
,
false
)
end
end
end
...
...
@@ -147,12 +147,12 @@ module Homebrew
else
c
=
formula_or_cask
c
.
outdated_info
(
args
.
greedy?
,
verbose?
,
true
)
c
.
outdated_info
(
args
.
greedy?
,
verbose?
(
args:
args
)
,
true
)
end
end
end
def
verbose?
def
verbose?
(
args
:)
(
$stdout
.
tty?
||
args
.
verbose?
)
&&
!
args
.
quiet?
end
...
...
@@ -169,19 +169,19 @@ module Homebrew
version_hash
[
version
]
end
def
outdated_formulae
select_outdated
((
args
.
resolved_formulae
.
presence
||
Formula
.
installed
)).
sort
def
outdated_formulae
(
args
:)
select_outdated
((
args
.
resolved_formulae
.
presence
||
Formula
.
installed
)
,
args:
args
).
sort
end
def
outdated_casks
def
outdated_casks
(
args
:)
if
args
.
named
.
present?
select_outdated
(
args
.
named
.
uniq
.
map
(
&
Cask
::
CaskLoader
.
method
(
:load
)))
select_outdated
(
args
.
named
.
uniq
.
map
(
&
Cask
::
CaskLoader
.
method
(
:load
))
,
args:
args
)
else
select_outdated
(
Cask
::
Caskroom
.
casks
)
select_outdated
(
Cask
::
Caskroom
.
casks
,
args:
args
)
end
end
def
outdated_formulae_casks
def
outdated_formulae_casks
(
args
:)
formulae
,
casks
=
args
.
resolved_formulae_casks
if
formulae
.
blank?
&&
casks
.
blank?
...
...
@@ -189,10 +189,10 @@ module Homebrew
casks
=
Cask
::
Caskroom
.
casks
end
[
select_outdated
(
formulae
),
select_outdated
(
casks
)]
[
select_outdated
(
formulae
,
args:
args
),
select_outdated
(
casks
,
args:
args
)]
end
def
select_outdated
(
formulae_or_casks
)
def
select_outdated
(
formulae_or_casks
,
args
:
)
formulae_or_casks
.
select
do
|
formula_or_cask
|
if
formula_or_cask
.
is_a?
(
Formula
)
formula_or_cask
.
outdated?
(
fetch_head:
args
.
fetch_HEAD?
)
...
...
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