Skip to content

Commit

Permalink
fix inaccessible dotfiles in check mode
Browse files Browse the repository at this point in the history
  • Loading branch information
cfillion committed Aug 16, 2024
1 parent 06541f6 commit c5b8e69
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/reapack/index.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
require 'addressable'
require 'colorize'
require 'fileutils'
require 'find'
require 'gitable'
require 'io/console'
require 'metaheader'
Expand Down
2 changes: 1 addition & 1 deletion lib/reapack/index/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ def do_check
@index.clear
failures = []

pkgs = Hash[Dir.glob("#{Regexp.quote(@git.path)}/**/*").sort.map {|abs|
pkgs = Hash[Find.find(@git.path).sort.map {|abs|
rel = @git.relative_path abs
@index.files << rel

Expand Down
14 changes: 14 additions & 0 deletions test/cli/test_check.rb
Original file line number Diff line number Diff line change
Expand Up @@ -189,4 +189,18 @@ def test_ignore_root

assert_match 'Finished checks for 0 packages with 0 failures', stderr
end

def test_dotfiles
setup = proc { mkfile 'index.xml', '<index name="test"/>' }

_, stderr = capture_io do
wrapper ['--check'], setup: setup do
mkfile 'Foo/.gitkeep'
mkfile 'Chunky/Bacon.lua', "@version 1.0\n@provides ../Foo/.gitkeep"
@cli.run
end
end

assert_match 'Finished checks for 1 package with 0 failures', stderr
end
end

0 comments on commit c5b8e69

Please sign in to comment.