Created
July 3, 2017 18:58
-
-
Save amcaplan/da7a865036a746ada18ac7488c177198 to your computer and use it in GitHub Desktop.
.gitmodules generation script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Assumes all your submodules are accessed via SSH, not HTTPS | |
template = <<-TEMPLATE | |
[submodule "%{submodule}"] | |
path = vim/.vim.symlink/bundle/%{submodule} | |
url = %{submodule_url} | |
ignore = dirty | |
TEMPLATE | |
puts Dir.foreach('.').reject { |i| %w(. .. script.rb).include? i }.map { |dir| | |
template % { submodule: dir, submodule_url: `cd #{dir} && git remote -v | grep -o 'git.*git' | head -1`.strip } | |
}.join |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment