patchr 0.1.2 → 0.1.4
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.
- data/VERSION +1 -1
- data/bin/patchr +7 -3
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.4
|
data/bin/patchr
CHANGED
@@ -27,7 +27,7 @@ def find_attachment(ticket_id)
|
|
27
27
|
choice = STDIN.gets.to_i - 1
|
28
28
|
attachments[choice]
|
29
29
|
else
|
30
|
-
|
30
|
+
attachments.first
|
31
31
|
end
|
32
32
|
end
|
33
33
|
|
@@ -57,11 +57,15 @@ elsif command == "apply"
|
|
57
57
|
|
58
58
|
# Create local branch and run tests
|
59
59
|
puts "Applying #{attachment.filename} of issue #{ticket_id}"
|
60
|
-
|
60
|
+
puts "Updating master"
|
61
|
+
system(`git checkout master`)
|
61
62
|
`git pull origin master`
|
62
|
-
|
63
|
+
branch_name = "#{ticket_id}-#{attachment.filename}"
|
64
|
+
`git checkout -b #{branch_name}`
|
63
65
|
patch_file = retrieve_patch_file(ticket_id, attachment)
|
66
|
+
puts patch_file
|
64
67
|
`git apply #{patch_file}`
|
68
|
+
`git commit -am "Applied patch #{branch_name}"`
|
65
69
|
puts "patch apply start running tests"
|
66
70
|
else
|
67
71
|
if command.blank?
|