Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'add_dev_update_submodules' into my_pulls

closes #284

* add_dev_update_submodules:
  Rakefile: Add a task to easly update all submodules.

Conflicts:
	Rakefile
  • Loading branch information...
commit 12a3bfc7fca329fb917b28c2b15f117cc19a91a9 2 parents 3bf380f + 357dbd4
@kalbasit kalbasit authored
Showing with 32 additions and 0 deletions.
  1. +32 −0 Rakefile
View
32 Rakefile
@@ -110,6 +110,38 @@ task :link_vim_conf_files do
end
end
+# 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
+
+namespace :dev do
+ desc "Update submodules"
+ task :update_submodules do
+ submodules.each do |submodule|
+ update_submodule(submodule)
+ end
+ end
+end
+
desc "Create necessary folders."
task :folders do
Janus::VIM.folders.each do |folder|
Please sign in to comment.
Something went wrong with that request. Please try again.