Skip to content

Commit

Permalink
feat(#228): path as last arg
Browse files Browse the repository at this point in the history
  • Loading branch information
h1alexbel committed Jul 1, 2024
1 parent c40c3ad commit ff83267
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions steps/discover-repos.rb
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,14 @@ def cooldown(opts, found)
sleep opts[:pause]
end

def files_in_repo(github, repo, path='', ref)
contents = github.contents(repo, {path: path, ref: ref})
def files_in_repo(github, repo, ref, path='')
contents = github.contents(repo, { path: path, ref: ref })
count = 0
contents.each do |content|
if content[:type] == 'file'
count += 1
elsif content[:type] == 'dir'
count += files_in_repo(github, repo, content[:path], ref)
count += files_in_repo(github, repo, ref, content[:path])
end
end
count
Expand Down

0 comments on commit ff83267

Please sign in to comment.