lib/dryrun.rb in dryrun-0.5.6 vs lib/dryrun.rb in dryrun-0.5.7
- old
+ new
@@ -14,19 +14,20 @@
# defaults
@app_path = nil
@custom_module = nil
@flavour = ''
+ @tag = nil
# Parse Options
arguments.push "-h" unless @url
create_options_parser(arguments)
end
def create_options_parser(args)
args.options do |opts|
- opts.banner = "Usage: dryrun GITHUB_URL [OPTIONS]"
+ opts.banner = "Usage: dryrun GIT_URL [OPTIONS]"
opts.separator ''
opts.separator "Options"
opts.on('-m MODULE_NAME', '--module MODULE_NAME', 'Custom module to run') do |custom_module|
@custom_module = custom_module
@@ -38,16 +39,20 @@
opts.on('-p PATH', '--path PATH', 'Custom path to android project') do |app_path|
@app_path = app_path
end
+ opts.on('-t TAG', '--tag TAG', 'Specifies a custom tag/commit hash to clone (e.g. "v0.4.5", "6f7dd4b")') do |tag|
+ @tag = tag
+ end
+
opts.on('-h', '--help', 'Displays help') do
puts opts.help
exit
end
- opts.on('-v', '--version', 'Displays version') do
+ opts.on('-v', '--version', 'Displays the version') do
puts DryRun::VERSION
exit
end
opts.parse!
@@ -69,15 +74,15 @@
end
github = Github.new(@url)
unless github.is_valid
- puts "#{@url.red} is not a valid github @url"
+ puts "#{@url.red} is not a valid git @url"
exit 1
end
# clone the repository
- repository_path = github.clone
+ repository_path = github.clone @tag
android_project = AndroidProject.new(repository_path, @app_path, @custom_module, @flavour)
# is a valid android project?
unless android_project.is_valid