Skip to content

Commit

Permalink
extconf.rb: Fix Dir.empty? check
Browse files Browse the repository at this point in the history
  • Loading branch information
glebm committed May 8, 2019
1 parent e1dbffe commit 22769b6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ext/extconf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
gem_root = File.expand_path('..', __dir__)
libsass_dir = File.join(gem_root, 'ext', 'libsass')

if !File.directory?(libsass_dir) || Dir.entries(libsass_dir).empty?
if !File.directory?(libsass_dir) ||
# Dir.empty? is only available on Ruby v2.4+
Dir.entries(libsass_dir).size == 2
Dir.chdir(gem_root) { system('git submodule update --init') }
end

Expand Down

0 comments on commit 22769b6

Please sign in to comment.