mirror of
https://github.com/zhigang1992/RubyMotion.git
synced 2026-06-11 08:14:16 +08:00
make 'motion --version' print both stable and pre-release versions
This commit is contained in:
committed by
Watson
parent
4afb269ef5
commit
d1b95f157a
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user