Display 'Up to date' in version.rb only with verbose option...for real (#12472)

This commit is contained in:
Ed Reel
2025-08-15 02:54:26 -05:00
committed by GitHub
parent 3538a91821
commit 38b844a091

View File

@@ -1,5 +1,5 @@
#!/usr/bin/env ruby
# version.rb version 1.9.1 (for Chromebrew)
# version.rb version 1.9.2 (for Chromebrew)
OPTIONS = %w[-h --help -j --json -u --update-package-files -v --verbose]
@@ -312,7 +312,7 @@ if filelist.length.positive?
when 'Updated.'
version_status_string = 'Updated.'.ljust(status_field_length).blue
when 'Up to date.'
version_status_string = 'Up to date.'.ljust(status_field_length).lightgreen if VERBOSE
version_status_string = 'Up to date.'.ljust(status_field_length).lightgreen
end
updatable_string = (updatable_pkg[@pkg.name.to_sym] == 'Yes' ? 'Yes'.lightgreen : 'No'.lightred) if updatable_string.nil?
cleaned_pkg_version = PackageUtils.get_clean_version(@pkg.version)
@@ -320,7 +320,7 @@ if filelist.length.positive?
addendum_string = "#{@pkg.name} cannot be automatically updated: ".red + "#{updatable_pkg[@pkg.name.to_sym]}\n".purple unless updatable_pkg[@pkg.name.to_sym] == 'Yes'
version_line_string[@pkg.name.to_sym] = "#{@pkg.name.ljust(package_field_length)}#{version_status_string}#{cleaned_pkg_version.ljust(version_field_length)}#{upstream_version.chomp.ljust(version_field_length)}#{updatable_string}\n"
print version_line_string[@pkg.name.to_sym] unless OUTPUT_JSON
print version_line_string[@pkg.name.to_sym] unless OUTPUT_JSON || ((versions_updated[@pkg.name.to_sym] == 'Up to date.') && !VERBOSE)
print addendum_string unless addendum_string.blank? || OUTPUT_JSON
print "Failed to update version in #{@pkg.name} to #{upstream_version.chomp}".yellow if !OUTPUT_JSON && (versions_updated[@pkg.name.to_sym].to_s == 'false')