Skip to content

Commit

Permalink
add 'motion changelog --pre' to open the pre-release NEWS file
Browse files Browse the repository at this point in the history
  • Loading branch information
lrz authored and Watson1978 committed Oct 13, 2014
1 parent 8f4baa5 commit 2a8497b
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion lib/motion/command/changelog.rb
Expand Up @@ -29,8 +29,25 @@ class Changelog < Command
self.description = 'View the changes that have been made in all ' \
'RubyMotion versions.'

def self.options
[
['--pre', 'Target a pre-release installation of RubyMotion'],
].concat(super)
end

def initialize(argv)
@prerelease_mode = argv.flag?('pre', false)
super
end

def run
system("#{pager} /Library/RubyMotion/NEWS")
file = '/Library/RubyMotion' + (@prerelease_mode ? 'Pre' : '') + '/NEWS'
if File.exist?(file)
system("#{pager} #{file}")
else
$stderr.puts "File `#{file}' does not exist"
exit 1
end
end
end
end; end

0 comments on commit 2a8497b

Please sign in to comment.