File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,7 +4,8 @@ bin_path = ENV["BUNDLE_BIN"] || Rails.root.join("bin")
44namespace :webpacker do
55 desc "Install Webpacker in this application"
66 task install : [ :check_node , :check_yarn ] do |task |
7- @@webpacker_installing = true
7+ Webpacker ::Configuration . installing = true
8+
89 prefix = task . name . split ( /#|webpacker:install/ ) . first
910
1011 if Rails ::VERSION ::MAJOR >= 5
Original file line number Diff line number Diff line change 33require "active_support/core_ext/hash/indifferent_access"
44
55class Webpacker ::Configuration
6+ class << self
7+ attr_accessor :installing
8+ end
9+
610 attr_reader :root_path , :config_path , :env
711
812 def initialize ( root_path :, config_path :, env :)
@@ -80,7 +84,7 @@ def load
8084 end
8185 config [ env ] . deep_symbolize_keys
8286 rescue Errno ::ENOENT => e
83- if @@webpacker_installing
87+ if self . class . installing
8488 { }
8589 else
8690 raise "Webpacker configuration file not found #{ config_path } . " \
You can’t perform that action at this time.
0 commit comments