Skip to content

Commit 5240a64

Browse files
committed
Handle the case where we can't find a Gemfile without raising
This fixes tests in query_packwerk when run without bundle exec. Usually this sort of thing is not an issue, so fixing it here prevents it from causing problem unnecessarily.
1 parent 5399a93 commit 5240a64

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/parse_packwerk/configuration.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,13 @@ def self.excludes(config_hash)
3737
Array(specified_exclude)
3838
end
3939

40-
excludes.push Bundler.bundle_path.join('**').to_s
40+
begin
41+
excludes.push Bundler.bundle_path.join('**').to_s
42+
rescue Bundler::GemfileNotFound
43+
# Not using a Gemfile, so we can't add the bundle path.
44+
end
45+
46+
excludes
4147
end
4248

4349
sig { params(config_hash: T::Hash[T.untyped, T.untyped]).returns(T::Array[String]) }

0 commit comments

Comments
 (0)