Skip to content

Commit

Permalink
Fix list not showing casks without source. (#23328)
Browse files Browse the repository at this point in the history
  • Loading branch information
reitermarkus committed Aug 13, 2016
1 parent 2ab8372 commit 666eed2
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/hbc/scopes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,17 @@ def installed
# TODO: speed up Hbc::Source::Tapped (main perf drag is calling Hbc.all_tokens repeatedly)
# TODO: ability to specify expected source when calling Hbc.load (minor perf benefit)
Pathname.glob(caskroom.join("*"))
.map { |dir| Hbc::Cask.new(dir.basename) }
.select(&:installed?)
.map { |cask|
.map { |caskroom_path|
token = caskroom_path.basename.to_s

path_to_cask = all_tapped_cask_dirs.find { |tap_dir|
tap_dir.join("#{cask.token}.rb").exist?
tap_dir.join("#{token}.rb").exist?
}

if path_to_cask
Hbc.load(path_to_cask.join("#{cask.token}.rb"))
Hbc.load(path_to_cask.join("#{token}.rb"))
else
Hbc.load(cask.token)
Hbc.load(token)
end
}
end
Expand Down

0 comments on commit 666eed2

Please sign in to comment.