Skip to content
This repository was archived by the owner on Oct 19, 2018. It is now read-only.

Commit 2e5a725

Browse files
committed
add git push task
1 parent a6561cd commit 2e5a725

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

tasks/git.rb

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,21 @@
5151
end
5252
end
5353

54-
desc "push all local hyperloop repos, accepts remote as argument, default origin"
55-
task :push do
54+
desc "push all local hyperloop repos, accepts remote and branch as arguments, defaults to origin and current branch"
55+
task :push, [:remote, :branch] do |_, arg|
56+
HYPERLOOP_REPOS.each do |repo|
57+
Dir.chdir(File.join('..', repo)) do
58+
puts "\033[0;32mPushing #{repo}:\033[0;30m"
59+
puts
60+
if arg[:remote] && arg[:branch]
61+
puts `git push --set-upstream #{arg[:remote]} #{arg[:branch]}`
62+
else
63+
puts `git push`
64+
end
65+
puts
66+
puts
67+
end
68+
end
5669
end
5770

5871
desc "show git status for local hyperloop repos"

0 commit comments

Comments
 (0)