diff options
| -rw-r--r-- | Library/Homebrew/download_strategy.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Library/Homebrew/download_strategy.rb b/Library/Homebrew/download_strategy.rb index 0305bf944..5f1a1a2d3 100644 --- a/Library/Homebrew/download_strategy.rb +++ b/Library/Homebrew/download_strategy.rb @@ -172,6 +172,13 @@ class GitDownloadStrategy <AbstractDownloadStrategy end # http://stackoverflow.com/questions/160608/how-to-do-a-git-export-like-svn-export safe_system 'git', 'checkout-index', '-a', '-f', "--prefix=#{dst}/" + # check for submodules + if File.exist?('.gitmodules') + safe_system 'git', 'submodule', 'init' + safe_system 'git', 'submodule', 'update' + sub_cmd = "git checkout-index -a -f --prefix=#{dst}/$path/" + safe_system 'git', 'submodule', '--quiet', 'foreach', '--recursive', sub_cmd + end end end end |
