This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby -wKU | |
# 110224, revised with loop to accept an array | |
def get_version(apps) | |
apps.each do |app| | |
if File.exists?("#{app}/Contents/Info.plist") | |
vers = `/usr/bin/defaults read "#{app}"/Contents/Info CFBundleShortVersionString`.chomp | |
puts "#{app.sub(/\/Applications\//, '')}: #{vers}" | |
$?.success? ? vers : "ERROR: could not get version" |