lib/dryrun.rb in dryrun-0.6.1 vs lib/dryrun.rb in dryrun-0.6.2
- old
+ new
@@ -15,10 +15,11 @@
# defaults
@app_path = nil
@custom_module = nil
@flavour = ''
@tag = nil
+ @branch = "master"
# Parse Options
arguments.push "-h" unless @url
create_options_parser(arguments)
end
@@ -31,19 +32,23 @@
opts.on('-m MODULE_NAME', '--module MODULE_NAME', 'Custom module to run') do |custom_module|
@custom_module = custom_module
end
- opts.on('-f', '--flavour FLAVOUR', 'Specifies the flavour (e.g. dev, qa, prod)') do |flavour|
+ opts.on('-b BRANCH_NAME', '--branch BRANCH_NAME', 'Checkout custom branch to run') do |branch|
+ @branch = branch
+ end
+
+ opts.on('-f', '--flavour FLAVOUR', 'Custom flavour (e.g. dev, qa, prod)') do |flavour|
@flavour = flavour.capitalize
end
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|
+ opts.on('-t TAG', '--tag TAG', 'Checkout 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
@@ -66,11 +71,11 @@
end
def call
unless android_home_is_defined
puts "\nWARNING: your #{'$ANDROID_HOME'.yellow} is not defined\n"
- puts "\nhint: in your #{'~/.bashrc'.yellow} add:\n #{"export ANDROID_HOME=\"/Users/cesarferreira/Library/Android/sdk/\"".yellow}"
+ puts "\nhint: in your #{'~/.bashrc'.yellow} or #{'~/.bash_profile'.yellow} add:\n #{"export ANDROID_HOME=\"/Users/cesarferreira/Library/Android/sdk/\"".yellow}"
puts "\nNow type #{'source ~/.bashrc'.yellow}\n\n"
exit 1
end
github = Github.new(@url)
@@ -79,10 +84,10 @@
puts "#{@url.red} is not a valid git @url"
exit 1
end
# clone the repository
- repository_path = github.clone @tag
+ repository_path = github.clone(@branch, @tag)
android_project = AndroidProject.new(repository_path, @app_path, @custom_module, @flavour)
# is a valid android project?
unless android_project.is_valid