Skip to content

Commit

Permalink
Merge pull request #502 from szechyjs/git-recursive
Browse files Browse the repository at this point in the history
Clone git repositories with --recursive flag.
  • Loading branch information
schisamo committed Jun 30, 2015
2 parents 5ad72a4 + 87c6ab5 commit 438bb35
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 10 additions & 1 deletion lib/omnibus/fetchers/git_fetcher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,15 @@ def source_url
source[:git]
end

#
# Determine if submodules should be cloned.
#
# @return [true, false]
#
def clone_submodules?
source[:submodules] || false
end

#
# Determine if a directory is empty
#
Expand Down Expand Up @@ -124,7 +133,7 @@ def cloned?
# @return [void]
#
def git_clone
git("clone #{source_url} .")
git("clone#{" --recursive" if clone_submodules?} #{source_url} .")
end

#
Expand Down
2 changes: 1 addition & 1 deletion lib/omnibus/software.rb
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ def source(val = NULL)
"be a kind of `Hash', but was `#{val.class.inspect}'")
end

extra_keys = val.keys - [:git, :path, :url, :md5, :cookie, :warning, :unsafe, :options]
extra_keys = val.keys - [:git, :path, :url, :md5, :cookie, :warning, :unsafe, :options, :submodules]
unless extra_keys.empty?
raise InvalidValue.new(:source,
"only include valid keys. Invalid keys: #{extra_keys.inspect}")
Expand Down

0 comments on commit 438bb35

Please sign in to comment.