Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Use "git submodule foreach" to update submodules

  • Loading branch information...
commit c07a034fa18b9830dcfbff748737a70c41515ebc 1 parent d0af227
@kalbasit kalbasit authored
Showing with 1 addition and 28 deletions.
  1. +1 −3 Rakefile
  2. +0 −1  janus/ruby/janus.rb
  3. +0 −24 janus/ruby/janus/git.rb
View
4 Rakefile
@@ -18,9 +18,7 @@ end
namespace :dev do
desc "Update submodules"
task :update_submodules do
- submodules.each do |submodule|
- update_submodule(submodule)
- end
+ sh "git submodule foreach git pull origin master"
end
# Taken from RefineryCMD
View
1  janus/ruby/janus.rb
@@ -51,7 +51,6 @@ def sudo(*args)
end
require 'janus/errors'
-require 'janus/git'
require 'janus/vim'
require 'janus/gems'
require 'janus/github'
View
24 janus/ruby/janus/git.rb
@@ -1,24 +0,0 @@
-module Janus
- # Get a list of submodules
- #
- # @return [Array] of submodules
- def submodules
- `git submodule`.split("\n").collect { |s| s.split(" ")[1] }
- end
-
- # Update a submodule
- #
- # @param [String] The submodule to update (relative path)
- # @param [String] The branch we're tracking
- def update_submodule(submodule, branch = "master")
- Dir.chdir submodule do
- puts
- puts "*" * 40
- puts "*#{"Updating #{submodule}".center(38)}*"
- puts "*" * 40
- puts
- sh "git checkout #{branch}"
- sh "git pull"
- end
- end
-end

0 comments on commit c07a034

Please sign in to comment.
Something went wrong with that request. Please try again.