Skip to content

Commit

Permalink
Merge pull request #3088 from projectblacklight/partial_revert_escape…
Browse files Browse the repository at this point in the history
…_bootstrap_version

Avoid double-escape in blacklight:assets generator with revert of shell escaping f491661
  • Loading branch information
jcoyne authored Oct 10, 2023
2 parents e72e0f7 + ef85748 commit 48d8a70
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 1 addition & 3 deletions lib/generators/blacklight/assets_generator.rb
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
# frozen_string_literal: true

require 'shellwords'

module Blacklight
class AssetsGenerator < Rails::Generators::Base
class_option :'bootstrap-version', type: :string, default: ENV.fetch('BOOTSTRAP_VERSION', '~> 5.1'), desc: "Set the generated app's bootstrap version"

def run_asset_pipeline_specific_generator
generated_options = "--bootstrap-version='#{Shellwords.escape(options[:'bootstrap-version'])}'" if options[:'bootstrap-version']
generated_options = "--bootstrap-version='#{options[:'bootstrap-version']}'" if options[:'bootstrap-version']

generator = if defined?(Propshaft)
'blacklight:assets:propshaft'
Expand Down
4 changes: 1 addition & 3 deletions lib/generators/blacklight/install_generator.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

require 'shellwords'

module Blacklight
class Install < Rails::Generators::Base
source_root File.expand_path('../templates', __FILE__)
Expand Down Expand Up @@ -37,7 +35,7 @@ def add_solr_wrapper
# Call external generator in AssetsGenerator, so we can
# leave that callable seperately too.
def copy_public_assets
generated_options = "--bootstrap-version='#{Shellwords.escape(options[:'bootstrap-version'])}'" if options[:'bootstrap-version']
generated_options = "--bootstrap-version='#{options[:'bootstrap-version']}'" if options[:'bootstrap-version']

generate "blacklight:assets", generated_options unless options[:'skip-assets']
end
Expand Down

0 comments on commit 48d8a70

Please sign in to comment.