Sha256: 0cd5cd38a8f02bad33a0d2f8a354871c3c47d0ac48a0c57ecfe98851731aeb53

Contents?: true

Size: 610 Bytes

Versions: 9

Compression:

Stored size: 610 Bytes

Contents

binstubs_template_path = File.expand_path("../../install/binstubs.rb", __dir__).freeze
bin_path = ENV["BUNDLE_BIN"] || Rails.root.join("bin")

namespace :webpacker do
  desc "Installs Webpacker binstubs in this application"
  task binstubs: [:check_node, :check_yarn] do |task|
    prefix = task.name.split(/#|webpacker:binstubs/).first

    if Rails::VERSION::MAJOR >= 5
      exec "#{RbConfig.ruby} #{bin_path}/rails #{prefix}app:template LOCATION=#{binstubs_template_path}"
    else
      exec "#{RbConfig.ruby} #{bin_path}/rake #{prefix}rails:template LOCATION=#{binstubs_template_path}"
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
webpacker-6.0.0.beta.6 lib/tasks/webpacker/binstubs.rake
webpacker-6.0.0.beta.5 lib/tasks/webpacker/binstubs.rake
webpacker-6.0.0.beta.4 lib/tasks/webpacker/binstubs.rake
webpacker-6.0.0.beta.3 lib/tasks/webpacker/binstubs.rake
webpacker-6.0.0.beta.2 lib/tasks/webpacker/binstubs.rake
webpacker-6.0.0.beta.1 lib/tasks/webpacker/binstubs.rake
webpacker-6.0.0.beta lib/tasks/webpacker/binstubs.rake
webpacker-6.0.0.pre.2 lib/tasks/webpacker/binstubs.rake
webpacker-6.0.0.pre.1 lib/tasks/webpacker/binstubs.rake