Skip to content

Commit b641cfc

Browse files
committed
Fix CLI entrypoint to detect Rails app instead of rescuing LoadError
1 parent 6873df7 commit b641cfc

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

exe/fixturebot

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#!/usr/bin/env ruby
22
# frozen_string_literal: true
33

4-
begin
4+
require "fixturebot"
5+
6+
if defined?(::Rails::Application)
57
require "fixturebot/rails"
68
FixtureBot::Rails::CLI.start(ARGV)
7-
rescue LoadError
8-
require "fixturebot"
9-
require "fixturebot/cli"
9+
else
1010
FixtureBot::CLI.start(ARGV)
1111
end

0 commit comments

Comments
 (0)