Skip to content

Commit

Permalink
Add auto-update column
Browse files Browse the repository at this point in the history
Closes #46
  • Loading branch information
buo committed Mar 23, 2017
1 parent 2f30862 commit c403efc
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/bcu.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,15 @@ def self.find_outdated_apps
end
end

table = [["No.", "Name", "Cask", "Current", "Latest", "State"]]
table = [["No.", "Name", "Cask", "Current", "Latest", "Auto-Update", "State"]]
installed.each_with_index do |app, i|
row = []
row << "#{i+1}/#{installed.length}"
row << app[:name].to_s
row << app[:token]
row << app[:current].join(", ")
row << app[:version]
row << (app[:auto_updates] ? "Y" : "")
if options.all && (app[:version] == "latest" || app[:auto_updates])
row << "forced to upgrade"
outdated.push app
Expand All @@ -84,14 +85,15 @@ def self.find_outdated_apps
end

def self.print_outdated_app(outdated)
table = [["No.", "Name", "Cask", "Current", "Latest", "State"]]
table = [["No.", "Name", "Cask", "Current", "Latest", "Auto-Update", "State"]]
outdated.each_with_index do |app, i|
row = []
row << "#{i+1}/#{outdated.length}"
row << app[:name].to_s
row << app[:token]
row << app[:current].join(", ")
row << app[:version]
row << (app[:auto_updates] ? "Y" : "")
if options.all && (app[:version] == "latest" || app[:auto_updates])
row << "forced to upgrade"
elsif app[:outdated?]
Expand Down

0 comments on commit c403efc

Please sign in to comment.