From d1b95f157afa2438e5a050c8bfdf90141adc5f1f Mon Sep 17 00:00:00 2001 From: Laurent Sansonetti Date: Thu, 23 Oct 2014 15:21:59 +0200 Subject: [PATCH] make 'motion --version' print both stable and pre-release versions --- lib/motion/command.rb | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/motion/command.rb b/lib/motion/command.rb index 84468a42..192036df 100644 --- a/lib/motion/command.rb +++ b/lib/motion/command.rb @@ -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)