Skip to content

Commit

Permalink
fix: output_dir check fails for empty directories in some environme…
Browse files Browse the repository at this point in the history
…nts (#55)
  • Loading branch information
aaronmiler authored Jan 15, 2025
1 parent 039147d commit f2ec889
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion js_from_routes/lib/js_from_routes/generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def config

# Public: Generates code for the specified routes with { export: true }.
def generate!(app_or_routes = Rails.application)
raise ArgumentError, "A Rails app must be defined, or you must specify a custom `output_folder`" if config.output_folder.blank?
raise ArgumentError, "A Rails app must be defined, or you must specify a custom `output_folder`" if config.output_folder.to_s.blank?
rails_routes = app_or_routes.is_a?(::Rails::Engine) ? app_or_routes.routes.routes : app_or_routes
generate_files exported_routes_by_controller(rails_routes)
end
Expand Down

0 comments on commit f2ec889

Please sign in to comment.