mirror of https://github.com/docker/docs.git
jekyll(fetch_remote): set fetch depth 0 if not a local build
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
parent
5f1b0f4f36
commit
a96dd76048
|
@ -40,6 +40,8 @@ module Jekyll
|
|||
def pre_read(site)
|
||||
beginning_time = Time.now
|
||||
puts "Starting plugin fetch_remote.rb..."
|
||||
|
||||
fetch_depth = get_docs_url == "http://localhost:4000" ? 1 : 0
|
||||
site.config['fetch-remote'].each do |entry|
|
||||
puts " Repo #{entry['repo']}"
|
||||
|
||||
|
@ -55,11 +57,11 @@ module Jekyll
|
|||
rescue => e
|
||||
FileUtils.rm_rf(clonedir)
|
||||
puts " Cloning repository into #{clonedir}"
|
||||
git = Git.clone("#{entry['repo']}.git", Pathname.new(clonedir), branch: entry['ref'], depth: 1)
|
||||
git = Git.clone("#{entry['repo']}.git", Pathname.new(clonedir), branch: entry['ref'], depth: fetch_depth)
|
||||
end
|
||||
else
|
||||
puts " Cloning repository into #{clonedir}"
|
||||
git = Git.clone("#{entry['repo']}.git", Pathname.new(clonedir), branch: entry['ref'], depth: 1)
|
||||
git = Git.clone("#{entry['repo']}.git", Pathname.new(clonedir), branch: entry['ref'], depth: fetch_depth)
|
||||
end
|
||||
|
||||
entry['paths'].each do |path|
|
||||
|
|
Loading…
Reference in New Issue