We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 6c98d2b + 31cf8b4 commit 4343324Copy full SHA for 4343324
Library/Homebrew/dev-cmd/livecheck.rb
@@ -78,9 +78,15 @@ def run
78
formulae + casks
79
elsif File.exist?(watchlist_path)
80
begin
81
+ # This removes blank lines, comment lines, and trailing comments
82
names = Pathname.new(watchlist_path).read.lines
- .reject { |line| line.start_with?("#") || line.blank? }
83
- .map(&:strip)
+ .filter_map do |line|
84
+ comment_index = line.index("#")
85
+ next if comment_index&.zero?
86
+
87
+ line = line[0...comment_index] if comment_index
88
+ line&.strip.presence
89
+ end
90
91
named_args = CLI::NamedArgs.new(*names, parent: args)
92
named_args.to_formulae_and_casks(ignore_unavailable: true)
0 commit comments