Skip to content

Commit d3896ee

Browse files
committed
add --skip-assets option to blacklight_range_limit:install generator
1 parent 7011dcf commit d3896ee

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,10 @@ Run `rails generate blacklight_range_limit:install`
3434

3535
### Manual Javascript setup is not hard
3636

37-
The installer could have trouble figuring out how to add Javascript to your particular setup. In the end, all you need is `blacklight-range-limit` either importmap-pinned (with its chart.js dependency), or added to your package.json, and then, in a file that has access to the `Blacklight` import:
37+
The installer could have trouble figuring out how to add Javascript to your particular setup. If it's not working right and you want the installer to skip asset generation, you can execute as `rails generate blacklight_range_limit:install --skip-assets`.
38+
39+
40+
In the end, all you need is `blacklight-range-limit` either importmap-pinned (with its chart.js dependency), or added to your package.json, and then, in a file that has access to the `Blacklight` import:
3841

3942
import BlacklightRangeLimit from "blacklight-range-limit";
4043
BlacklightRangeLimit.init({ onLoadHandler: Blacklight.onLoad });

lib/generators/blacklight_range_limit/install_generator.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,13 @@ module BlacklightRangeLimit
44
class InstallGenerator < Rails::Generators::Base
55
source_root File.expand_path('../templates', __FILE__)
66

7+
class_option :'skip-assets', type: :boolean, default: false, desc: "Skip generation of assets into app"
78
class_option :'builder-path', type: :string, default: 'app/models/search_builder.rb', aliases: "-b", desc: "Set the path, relative to Rails root, to the Blacklight app's search builder class"
89

910
def generate_assets
10-
generate 'blacklight_range_limit:assets'
11+
unless options[:'skip-assets']
12+
generate 'blacklight_range_limit:assets'
13+
end
1114
end
1215

1316
def install_catalog_controller_mixin

0 commit comments

Comments
 (0)