File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,8 @@ bin_path = ENV["BUNDLE_BIN"] || Rails.root.join("bin")
4
4
namespace :webpacker do
5
5
desc "Install Webpacker in this application"
6
6
task install : [ :check_node , :check_yarn ] do |task |
7
- @@webpacker_installing = true
7
+ Webpacker ::Configuration . installing = true
8
+
8
9
prefix = task . name . split ( /#|webpacker:install/ ) . first
9
10
10
11
if Rails ::VERSION ::MAJOR >= 5
Original file line number Diff line number Diff line change 3
3
require "active_support/core_ext/hash/indifferent_access"
4
4
5
5
class Webpacker ::Configuration
6
+ class << self
7
+ attr_accessor :installing
8
+ end
9
+
6
10
attr_reader :root_path , :config_path , :env
7
11
8
12
def initialize ( root_path :, config_path :, env :)
@@ -80,7 +84,7 @@ def load
80
84
end
81
85
config [ env ] . deep_symbolize_keys
82
86
rescue Errno ::ENOENT => e
83
- if @@webpacker_installing
87
+ if self . class . installing
84
88
{ }
85
89
else
86
90
raise "Webpacker configuration file not found #{ config_path } . " \
You can’t perform that action at this time.
0 commit comments