dryrun 0.6.1 → 0.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +4 -3
- data/lib/dryrun.rb +9 -4
- data/lib/dryrun/github.rb +4 -3
- data/lib/dryrun/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 76567467625da0c51f4bc39f919defb04f806a5a
|
4
|
+
data.tar.gz: 156aa3d9b9ea03f578bc946e18c372b0bbd50f28
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 209ceae395b9f7fccc581c5f991cbf30ba430cb67ce888255ccf32cd7f048d95ff934357429c97545d3abbba3b5b88336924e91ba26388f3289f121f2814a10e
|
7
|
+
data.tar.gz: 3b9d1d333aedd35ef8ad0eeb4705a3e4fce0355bee783c990447ba26acfdffc711d8d789d81582c8d896615e9fc27d42e2b16eede7bbda7bf91792a3cf9b367b
|
data/README.md
CHANGED
@@ -21,11 +21,12 @@ Usage: dryrun GIT_URL [OPTIONS]
|
|
21
21
|
|
22
22
|
Options
|
23
23
|
-m, --module MODULE_NAME Custom module to run
|
24
|
-
-
|
24
|
+
-b, --branch BRANCH_NAME Checkout custom branch to run
|
25
|
+
-f, --flavour FLAVOUR Custom flavour (e.g. dev, qa, prod)
|
25
26
|
-p, --path PATH Custom path to android project
|
26
|
-
-t, --tag TAG
|
27
|
+
-t, --tag TAG Checkout tag/commit hash to clone (e.g. "v0.4.5", "6f7dd4b")
|
27
28
|
-h, --help Displays help
|
28
|
-
-v, --version Displays version
|
29
|
+
-v, --version Displays the version
|
29
30
|
```
|
30
31
|
|
31
32
|
## Installation
|
data/lib/dryrun.rb
CHANGED
@@ -17,6 +17,7 @@ module DryRun
|
|
17
17
|
@custom_module = nil
|
18
18
|
@flavour = ''
|
19
19
|
@tag = nil
|
20
|
+
@branch = "master"
|
20
21
|
|
21
22
|
# Parse Options
|
22
23
|
arguments.push "-h" unless @url
|
@@ -33,7 +34,11 @@ module DryRun
|
|
33
34
|
@custom_module = custom_module
|
34
35
|
end
|
35
36
|
|
36
|
-
|
37
|
+
opts.on('-b BRANCH_NAME', '--branch BRANCH_NAME', 'Checkout custom branch to run') do |branch|
|
38
|
+
@branch = branch
|
39
|
+
end
|
40
|
+
|
41
|
+
opts.on('-f', '--flavour FLAVOUR', 'Custom flavour (e.g. dev, qa, prod)') do |flavour|
|
37
42
|
@flavour = flavour.capitalize
|
38
43
|
end
|
39
44
|
|
@@ -41,7 +46,7 @@ module DryRun
|
|
41
46
|
@app_path = app_path
|
42
47
|
end
|
43
48
|
|
44
|
-
opts.on('-t TAG', '--tag TAG', '
|
49
|
+
opts.on('-t TAG', '--tag TAG', 'Checkout tag/commit hash to clone (e.g. "v0.4.5", "6f7dd4b")') do |tag|
|
45
50
|
@tag = tag
|
46
51
|
end
|
47
52
|
|
@@ -68,7 +73,7 @@ module DryRun
|
|
68
73
|
def call
|
69
74
|
unless android_home_is_defined
|
70
75
|
puts "\nWARNING: your #{'$ANDROID_HOME'.yellow} is not defined\n"
|
71
|
-
puts "\nhint: in your #{'~/.bashrc'.yellow} add:\n #{"export ANDROID_HOME=\"/Users/cesarferreira/Library/Android/sdk/\"".yellow}"
|
76
|
+
puts "\nhint: in your #{'~/.bashrc'.yellow} or #{'~/.bash_profile'.yellow} add:\n #{"export ANDROID_HOME=\"/Users/cesarferreira/Library/Android/sdk/\"".yellow}"
|
72
77
|
puts "\nNow type #{'source ~/.bashrc'.yellow}\n\n"
|
73
78
|
exit 1
|
74
79
|
end
|
@@ -81,7 +86,7 @@ module DryRun
|
|
81
86
|
end
|
82
87
|
|
83
88
|
# clone the repository
|
84
|
-
repository_path = github.clone @tag
|
89
|
+
repository_path = github.clone(@branch, @tag)
|
85
90
|
|
86
91
|
android_project = AndroidProject.new(repository_path, @app_path, @custom_module, @flavour)
|
87
92
|
|
data/lib/dryrun/github.rb
CHANGED
@@ -46,7 +46,7 @@ module DryRun
|
|
46
46
|
##
|
47
47
|
## CLONE THE REPOSITORY
|
48
48
|
##
|
49
|
-
def clone(tag)
|
49
|
+
def clone(branch, tag)
|
50
50
|
clonable = self.clonable_url
|
51
51
|
|
52
52
|
tmpdir = Dir.tmpdir+"/dryrun/#{@destination}"
|
@@ -59,12 +59,13 @@ module DryRun
|
|
59
59
|
if !is_git_repo
|
60
60
|
FileUtils.rm_rf(tmpdir)
|
61
61
|
DryrunUtils.execute("git clone #{clonable} #{tmpdir}")
|
62
|
+
DryrunUtils.execute("git checkout #{branch}")
|
62
63
|
else
|
63
64
|
puts "Found project in #{tmpdir.green}..."
|
64
65
|
DryrunUtils.execute("git reset --hard HEAD")
|
65
66
|
DryrunUtils.execute("git fetch --all")
|
66
|
-
DryrunUtils.execute("git checkout
|
67
|
-
DryrunUtils.execute("git pull origin
|
67
|
+
DryrunUtils.execute("git checkout #{branch}")
|
68
|
+
DryrunUtils.execute("git pull origin #{branch}")
|
68
69
|
end
|
69
70
|
|
70
71
|
else
|
data/lib/dryrun/version.rb
CHANGED