make 'motion --version' print both stable and pre-release versions

This commit is contained in:
Laurent Sansonetti
2014-10-23 15:21:59 +02:00
committed by Watson
parent 4afb269ef5
commit d1b95f157a

View File

@@ -80,10 +80,19 @@ module Motion
].concat(super)
end
module Pre
path = '/Library/RubyMotionPre/lib/motion/version.rb'
eval(File.read(path)) if File.exist?(path)
end
def self.run(argv)
argv = CLAide::ARGV.new(argv)
if argv.flag?('version')
$stdout.puts Motion::Version
if defined?(Pre::Motion::Version)
$stdout.puts "#{Motion::Version} (stable), #{Pre::Motion::Version} (pre-release)"
else
$stdout.puts Motion::Version
end
exit 0
end
super(argv)